Mercurial > vim
annotate runtime/indent/gitconfig.vim @ 18977:5bef1043abff v8.2.0049
patch 8.2.0049: command line completion not fully tested
Commit: https://github.com/vim/vim/commit/297610ba4b110c918ffe60c45eb4a1d6ea2daae5
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Dec 27 17:20:55 2019 +0100
patch 8.2.0049: command line completion not fully tested
Problem: Command line completion not fully tested.
Solution: Add more test cases. Make help sorting stable. (Dominique Pelle,
closes #5402)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 27 Dec 2019 17:30:03 +0100 |
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 |