Mercurial > vim
view runtime/indent/gitconfig.vim @ 24178:d5328b2b0edf v8.2.2630
patch 8.2.2630: hard to see where a test gets stuck
Commit: https://github.com/vim/vim/commit/592f57f5fec1064cc276a0d7992cc543bed04fd5
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 20 16:44:25 2021 +0100
patch 8.2.2630: hard to see where a test gets stuck
Problem: Hard to see where a test gets stuck.
Solution: Print the executed test function. (Dominique Pell?, closes https://github.com/vim/vim/issues/7975)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 20 Mar 2021 16:45:02 +0100 |
parents | 63b0b7b79b25 |
children |
line wrap: on
line source
" Vim indent file " Language: git config file " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Last Change: 2017 Jun 13 if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal autoindent setlocal indentexpr=GetGitconfigIndent() setlocal indentkeys=o,O,*<Return>,0[,],0;,0#,=,!^F let b:undo_indent = 'setl ai< inde< indk<' " Only define the function once. if exists("*GetGitconfigIndent") finish endif function! GetGitconfigIndent() let sw = shiftwidth() let line = getline(prevnonblank(v:lnum-1)) let cline = getline(v:lnum) if line =~ '\\\@<!\%(\\\\\)*\\$' " odd number of slashes, in a line continuation return 2 * sw elseif cline =~ '^\s*\[' return 0 elseif cline =~ '^\s*\a' return sw elseif cline == '' && line =~ '^\[' return sw else return -1 endif endfunction