From 11f34624aa32ac72dc65e46ea9badb4b16a0edd1 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 19 Jul 2016 10:09:54 +0200 Subject: Update --- indent/rust.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indent/rust.vim') diff --git a/indent/rust.vim b/indent/rust.vim index 0a3c3344..fec789de 100644 --- a/indent/rust.vim +++ b/indent/rust.vim @@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'rust') == -1 " Vim indent file " Language: Rust " Author: Chris Morgan -" Last Change: 2014 Sep 13 +" Last Change: 2016 Jul 15 " Only load this indent file when no other was loaded. if exists("b:did_indent") @@ -134,6 +134,7 @@ function GetRustIndent(lnum) \ && s:get_line_trimmed(a:lnum) !~ '^\s*[\[\]{}]' \ && prevline !~ '^\s*fn\s' \ && prevline !~ '([^()]\+,$' + \ && s:get_line_trimmed(a:lnum) !~ '^\s*\S\+\s*=>' " Oh ho! The previous line ended in a comma! I bet cindent will try to " take this too far... For now, let's normally use the previous line's " indent. @@ -158,6 +159,8 @@ function GetRustIndent(lnum) " if baz && (foo || " bar) { " + " Another case is when the current line is a new match arm. + " " There are probably other cases where we don't want to do this as " well. Add them as needed. return indent(prevlinenum) -- cgit v1.2.3