diff --git a/indent/rust.vim b/indent/rust.vim index 6edce73f..d13c33ae 100644 --- a/indent/rust.vim +++ b/indent/rust.vim @@ -235,6 +235,12 @@ function GetRustIndent(lnum) return indent(prevlinenum) endif + " if the previous line ends with '];' then it is the end of an array literal. The current line + " should start from the same position as the previous one. + if prevline[len(prevline) - 2:] ==# "];" + return indent(prevlinenum) + endif + if !has("patch-7.4.355") " cindent before 7.4.355 doesn't do the module scope well at all; e.g.:: "