diff options
Diffstat (limited to 'indent')
-rw-r--r-- | indent/cucumber.vim | 4 | ||||
-rw-r--r-- | indent/gitconfig.vim | 4 | ||||
-rw-r--r-- | indent/rust.vim | 7 |
3 files changed, 10 insertions, 5 deletions
diff --git a/indent/cucumber.vim b/indent/cucumber.vim index f6565b8a..a9960b02 100644 --- a/indent/cucumber.vim +++ b/indent/cucumber.vim @@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'cucumber') == - " Vim indent file " Language: Cucumber " Maintainer: Tim Pope <vimNOSPAM@tpope.org> -" Last Change: 2013 May 30 +" Last Change: 2017 Jun 13 if exists("b:did_indent") finish @@ -29,7 +29,7 @@ function! GetCucumberIndent() let line = getline(prevnonblank(v:lnum-1)) let cline = getline(v:lnum) let nline = getline(nextnonblank(v:lnum+1)) - let sw = exists('*shiftwidth') ? shiftwidth() : &sw + let sw = exists('*shiftwidth') ? shiftwidth() : shiftwidth() let syn = s:syn(prevnonblank(v:lnum-1)) let csyn = s:syn(v:lnum) let nsyn = s:syn(nextnonblank(v:lnum+1)) diff --git a/indent/gitconfig.vim b/indent/gitconfig.vim index 3e764dee..53dff35a 100644 --- a/indent/gitconfig.vim +++ b/indent/gitconfig.vim @@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'git') == -1 " Vim indent file " Language: git config file " Maintainer: Tim Pope <vimNOSPAM@tpope.org> -" Last Change: 2013 May 30 +" Last Change: 2017 Jun 13 if exists("b:did_indent") finish @@ -22,7 +22,7 @@ if exists("*GetGitconfigIndent") endif function! GetGitconfigIndent() - let sw = exists('*shiftwidth') ? shiftwidth() : &sw + let sw = shiftwidth() let line = getline(prevnonblank(v:lnum-1)) let cline = getline(v:lnum) if line =~ '\\\@<!\%(\\\\\)*\\$' diff --git a/indent/rust.vim b/indent/rust.vim index 0c2876b8..69070b46 100644 --- a/indent/rust.vim +++ b/indent/rust.vim @@ -193,7 +193,12 @@ function GetRustIndent(lnum) " A line that ends with '.<expr>;' is probably an end of a long list " of method operations. if prevline =~# '\V\^\s\*.' && l:last_prevline_character ==# ';' - return indent(prevlinenum) - s:shiftwidth() + call cursor(a:lnum - 1, 1) + let l:scope_start = searchpair('{\|(', '', '}\|)', 'nbW', + \ 's:is_string_comment(line("."), col("."))') + if l:scope_start != 0 && l:scope_start < a:lnum + return indent(l:scope_start) + 4 + endif endif if l:last_prevline_character ==# "," |