diff options
Diffstat (limited to 'indent/typescript.vim')
-rw-r--r-- | indent/typescript.vim | 18 |
1 files changed, 15 insertions, 3 deletions
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 |