summaryrefslogtreecommitdiffstats
path: root/indent/typescript.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2015-05-11 15:05:13 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2015-05-11 15:05:13 +0200
commit271b63d71707720ad0d35590b8cb50f8f8f43014 (patch)
tree1b71daa457afc68465f66ee2afc9a00c1380f23d /indent/typescript.vim
parentacd7ce59503b22ac7663fc25776efe25e266f1d4 (diff)
downloadvim-polyglot-1.13.2.tar.gz
vim-polyglot-1.13.2.zip
Updatev1.13.2
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