Skip to content

Commit

Permalink
Dedent on curly braces on other blocks like for
Browse files Browse the repository at this point in the history
Based on rust.kak
Fix rust-lang#421
  • Loading branch information
pickfire committed Sep 27, 2020
1 parent 96e79e3 commit 53682f4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions indent/rust.vim
Expand Up @@ -142,9 +142,8 @@ function GetRustIndent(lnum)
let l:standalone_close = line =~# '\V\^\s\*}\s\*\$'
let l:standalone_where = line =~# '\V\^\s\*where\s\*\$'
if l:standalone_open || l:standalone_close || l:standalone_where
" ToDo: we can search for more items than 'fn' and 'if'.
let [l:found_line, l:col, l:submatch] =
\ searchpos('\<\(fn\)\|\(if\)\>', 'bnWp')
\ searchpos('\<\(impl\)\|\(fn\)\|\(struct\)\|\(enum\)\|\(union\)\|\(if\)\|\(for\)\>', 'bnWp')
if l:found_line !=# 0
" Now we count the number of '{' and '}' in between the match
" locations and the current line (there is probably a better
Expand Down

0 comments on commit 53682f4

Please sign in to comment.