Mercurial > vim
annotate runtime/indent/gitolite.vim @ 19952:82ea10d554fb v8.2.0532
patch 8.2.0532: cannot use simplify() as a method
Commit: https://github.com/vim/vim/commit/7035fd9d909c49cf5105a53753c1772c193d05b8
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Apr 8 20:03:52 2020 +0200
patch 8.2.0532: cannot use simplify() as a method
Problem: Cannot use simplify() as a method.
Solution: Add FEARG_1. (closes https://github.com/vim/vim/issues/5996)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 08 Apr 2020 20:15:04 +0200 |
parents | 3b26420fc639 |
children | 6dd88e45d47d |
rev | line source |
---|---|
3224 | 1 " Vim indent file |
2 " Language: gitolite configuration | |
12756
3b26420fc639
Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents:
11518
diff
changeset
|
3 " URL: https://github.com/sitaramc/gitolite/blob/master/contrib/vim/indent/gitolite.vim |
3b26420fc639
Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents:
11518
diff
changeset
|
4 " (https://raw.githubusercontent.com/sitaramc/gitolite/master/contrib/vim/indent/gitolite.vim) |
3b26420fc639
Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents:
11518
diff
changeset
|
5 " Maintainer: Sitaram Chamarty <sitaramc@gmail.com> |
3b26420fc639
Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents:
11518
diff
changeset
|
6 " (former Maintainer: Teemu Matilainen <teemu.matilainen@iki.fi>) |
3b26420fc639
Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents:
11518
diff
changeset
|
7 " Last Change: 2017 Oct 05 |
3224 | 8 |
9 if exists("b:did_indent") | |
10 finish | |
11 endif | |
12 let b:did_indent = 1 | |
13 | |
14 setlocal autoindent | |
15 setlocal indentexpr=GetGitoliteIndent() | |
16 setlocal indentkeys=o,O,*<Return>,!^F,=repo,\",= | |
17 | |
18 " Only define the function once. | |
19 if exists("*GetGitoliteIndent") | |
20 finish | |
21 endif | |
22 | |
3237 | 23 let s:cpo_save = &cpo |
24 set cpo&vim | |
25 | |
3224 | 26 function! GetGitoliteIndent() |
27 let prevln = prevnonblank(v:lnum-1) | |
28 let pline = getline(prevln) | |
29 let cline = getline(v:lnum) | |
30 | |
31 if cline =~ '^\s*\(C\|R\|RW\|RW+\|RWC\|RW+C\|RWD\|RW+D\|RWCD\|RW+CD\|-\)[ \t=]' | |
11518 | 32 return shiftwidth() |
3224 | 33 elseif cline =~ '^\s*config\s' |
11518 | 34 return shiftwidth() |
12756
3b26420fc639
Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents:
11518
diff
changeset
|
35 elseif cline =~ '^\s*option\s' |
3b26420fc639
Long overdue runtime update.
Christian Brabandt <cb@256bit.org>
parents:
11518
diff
changeset
|
36 return shiftwidth() |
3224 | 37 elseif pline =~ '^\s*repo\s' && cline =~ '^\s*\(#.*\)\?$' |
11518 | 38 return shiftwidth() |
3224 | 39 elseif cline =~ '^\s*#' |
40 return indent(prevln) | |
41 elseif cline =~ '^\s*$' | |
42 return -1 | |
43 else | |
44 return 0 | |
45 endif | |
46 endfunction | |
3237 | 47 |
48 let &cpo = s:cpo_save | |
49 unlet s:cpo_save |