summaryrefslogtreecommitdiffstats
path: root/indent/rust.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2019-12-07 12:21:37 +0100
committerAdam Stankiewicz <sheerun@sher.pl>2019-12-07 12:21:37 +0100
commit7a0f2d974f9ac5bc85607e8c769d3370dd18ac74 (patch)
tree5c2b955af8e0f2ed54442d9e938fad403148ffce /indent/rust.vim
parent15aeea662e0b08088ac7b6e3ee661c834e69106a (diff)
downloadvim-polyglot-4.1.2.tar.gz
vim-polyglot-4.1.2.zip
Updatev4.1.2
Diffstat (limited to 'indent/rust.vim')
-rw-r--r--indent/rust.vim7
1 files changed, 6 insertions, 1 deletions
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 ==# ","