Mercurial > vim
annotate runtime/indent/gitconfig.vim @ 17752:6e11a5cb1533 v8.1.1873
patch 8.1.1873: cannot build tiny version
commit https://github.com/vim/vim/commit/df707755554ecc102a908e8d5b64f2903f4f3686
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 17 17:50:07 2019 +0200
patch 8.1.1873: cannot build tiny version
Problem: Cannot build tiny version.
Solution: Remove #ifdef for is_autocmd_blocked().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 17 Aug 2019 18:00:03 +0200 |
parents | 63b0b7b79b25 |
children |
rev | line source |
---|---|
1620 | 1 " Vim indent file |
2 " Language: git config file | |
2034 | 3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org> |
11518 | 4 " Last Change: 2017 Jun 13 |
1620 | 5 |
6 if exists("b:did_indent") | |
7 finish | |
8 endif | |
9 let b:did_indent = 1 | |
10 | |
11 setlocal autoindent | |
12 setlocal indentexpr=GetGitconfigIndent() | |
13 setlocal indentkeys=o,O,*<Return>,0[,],0;,0#,=,!^F | |
14 | |
3465 | 15 let b:undo_indent = 'setl ai< inde< indk<' |
16 | |
1620 | 17 " Only define the function once. |
18 if exists("*GetGitconfigIndent") | |
19 finish | |
20 endif | |
21 | |
22 function! GetGitconfigIndent() | |
11518 | 23 let sw = shiftwidth() |
2202 | 24 let line = getline(prevnonblank(v:lnum-1)) |
25 let cline = getline(v:lnum) | |
26 if line =~ '\\\@<!\%(\\\\\)*\\$' | |
27 " odd number of slashes, in a line continuation | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
28 return 2 * sw |
2202 | 29 elseif cline =~ '^\s*\[' |
30 return 0 | |
31 elseif cline =~ '^\s*\a' | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
32 return sw |
2202 | 33 elseif cline == '' && line =~ '^\[' |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
34 return sw |
2202 | 35 else |
36 return -1 | |
37 endif | |
1620 | 38 endfunction |