Mercurial > vim
annotate runtime/indent/gitconfig.vim @ 20679:1af1d8ff2aa8 v8.2.0893
patch 8.2.0893: assert_equalfile() does not take a third argument
Commit: https://github.com/vim/vim/commit/fb517bac2384798bb5142ed1f75f965f93984c0a
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jun 3 19:55:35 2020 +0200
patch 8.2.0893: assert_equalfile() does not take a third argument
Problem: Assert_equalfile() does not take a third argument.
Solution: Implement the third argument. (Gary Johnson)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 03 Jun 2020 20:00:04 +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 |