summaryrefslogtreecommitdiffstats
path: root/indent/typescript.vim
diff options
context:
space:
mode:
Diffstat (limited to 'indent/typescript.vim')
-rw-r--r--indent/typescript.vim10
1 files changed, 10 insertions, 0 deletions
diff --git a/indent/typescript.vim b/indent/typescript.vim
index f498298b..78d04c5c 100644
--- a/indent/typescript.vim
+++ b/indent/typescript.vim
@@ -3,6 +3,10 @@
" Maintainer: None! Wanna improve this?
" Last Change: 2015 Mar 07
+if get(g:, 'typescript_indent_disable')
+ finish
+endif
+
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
@@ -54,6 +58,12 @@ 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\+'
+ return indent(prev)
+ endif
+
" Try to find out whether the last `}` ended a `<variable> : {` block
if getline(prev) =~ '};\s*$'
" jump to matching `{` bracket