From 559bbdc0e74d89705eb4cef8bf2bed8a9c46a1ec Mon Sep 17 00:00:00 2001 From: ANtlord Date: Sun, 25 Jul 2021 14:08:59 +0000 Subject: [PATCH] Fix indentation after an array literal --- indent/rust.vim | 6 ++++++ 1 file changed, 6 insertions(+) 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.:: "