Mercurial > vim
annotate runtime/indent/gitconfig.vim @ 8271:770774e66011 v7.4.1428
commit https://github.com/vim/vim/commit/edb4f2b3601b0abd47091606269c0ac3244a805b
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 27 15:27:23 2016 +0100
patch 7.4.1428
Problem: Compiler warning for non-virtual destructor.
Solution: Make it virtual. (Yasuhiro Matsumoto)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 27 Feb 2016 15:30:05 +0100 |
parents | 2eb30f341e8d |
children | 43efa4f5a8ea |
rev | line source |
---|---|
1620 | 1 " Vim indent file |
2 " Language: git config file | |
2034 | 3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org> |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
3465
diff
changeset
|
4 " Last Change: 2013 May 30 |
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() | |
2202 | 23 let line = getline(prevnonblank(v:lnum-1)) |
24 let cline = getline(v:lnum) | |
25 if line =~ '\\\@<!\%(\\\\\)*\\$' | |
26 " odd number of slashes, in a line continuation | |
27 return 2 * &sw | |
28 elseif cline =~ '^\s*\[' | |
29 return 0 | |
30 elseif cline =~ '^\s*\a' | |
31 return &sw | |
32 elseif cline == '' && line =~ '^\[' | |
33 return &sw | |
34 else | |
35 return -1 | |
36 endif | |
1620 | 37 endfunction |