llvm.org GIT mirror llvm / 79597d7
Vim: Fix some bugs in llvm indent plugin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236464 91177308-0d34-0410-b5e6-96231b3b80d8 Matthias Braun 4 years ago
1 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
2424 finish
2525 endif
2626
27 function! FindOpenBracket(lnum)
27 function! FindOpenBrace(lnum)
2828 call cursor(a:lnum, 1)
2929 return searchpair('{', '', '}', 'bW')
3030 endfun
4343
4444 " Indent labels the same as the current opening block
4545 if thisline =~ ':\s*$'
46 let blockbegin = FindOpenBracket(v:lnum)
46 let blockbegin = FindOpenBrace(v:lnum)
4747 if blockbegin > 0
4848 return indent(blockbegin)
4949 endif
5151
5252 " Find a non-blank not-completely commented line above the current line.
5353 let prev_lnum = prevnonblank(v:lnum - 1)
54 while prev_num > 0 && synIDattr(synID(prev_lnum, indent(prev_lnum)+1, 0), "name") =? "string\|comment"
54 while prev_lnum > 0 && synIDattr(synID(prev_lnum, indent(prev_lnum)+1, 0), "name") =? "string\|comment"
5555 let prev_lnum = prevnonblank(prev_lnum-1)
5656 endwhile
5757 " Hit the start of the file, use zero indent.