From 0de043adbc144510635702dadedc946e3c69f64e Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Sat, 10 Oct 2015 16:56:22 +0200 Subject: Update --- indent/typescript.vim | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'indent/typescript.vim') diff --git a/indent/typescript.vim b/indent/typescript.vim index 73bce658..58dc7d03 100644 --- a/indent/typescript.vim +++ b/indent/typescript.vim @@ -60,9 +60,21 @@ function GetTypescriptIndent() return indent(prev) endif - " If a variable was declared and the semicolon omitted, do not indent - " the next line - if getline(prev) =~ '^\s*var\s\+\w\+' + " If the previous line starts with '@', we should have the same indent as + " the previous one + if getline(prev) =~ '^\s*@\S\+\s*$' + return indent(prev) + endif + + " If a var, let, or const was declared and the semicolon omitted, do not + " indent the next line + if getline(prev) =~ '^\s*\(var\|let\|const\)\s\+\w\+' + return indent(prev) + endif + + " If the line ended with a ',', we should have the same indent as + " the previous one + if getline(prev) =~ ',\s*$' return indent(prev) endif -- cgit v1.2.3