From 708bfa5786c3e3c00f0599f5ec75b37e0b33851a Mon Sep 17 00:00:00 2001 From: Chris Paul Date: Wed, 5 Oct 2016 23:52:18 -0700 Subject: [PATCH 1/5] Misc regex improvements --- indent/javascript.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indent/javascript.vim b/indent/javascript.vim index 1f1786c3..2430fa14 100644 --- a/indent/javascript.vim +++ b/indent/javascript.vim @@ -72,7 +72,7 @@ endfunction " configurable regexes that define continuation lines, not including (, {, or [. if !exists('g:javascript_opfirst') - let g:javascript_opfirst = '\%([<>,?^%|*&]\|\/[^/*]\|\([-.:+]\)\1\@!\|=>\@!\|in\%(stanceof\)\=\>\)' + let g:javascript_opfirst = '\%([<>,?^%|*&]\|\/[/*]\@!\|\([-.:+]\)\1\@!\|=>\@!\|in\%(stanceof\)\=\>\)' endif if !exists('g:javascript_continuation') let g:javascript_continuation = '\%([<=,.?/*^%|&:]\|+\@\|\ Date: Wed, 5 Oct 2016 23:54:38 -0700 Subject: [PATCH 2/5] Update javascript.vim --- indent/javascript.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indent/javascript.vim b/indent/javascript.vim index 2430fa14..bc5932e6 100644 --- a/indent/javascript.vim +++ b/indent/javascript.vim @@ -94,7 +94,7 @@ function s:iscontOne(i,num,cont) let ind = indent(l:i) + (!l:cont * s:W) let bL = 0 while l:i >= l:num && (!l:cont || ind > pind + s:W) - if indent(l:i) < ind " first line always true for !cont, false for !!cont + if indent(l:i) < ind " first line always true for !a:cont, false for !!a:cont if s:OneScope(l:i,s:Trimline(l:i)) if expand('') ==# 'while' && s:GetPair(s:line_pre . '\C\','\C\','bW',s:skip_expr,100,l:num) > 0 return 0 From f9a584b2191b5a6470f04208be98a5c9a6fbc17c Mon Sep 17 00:00:00 2001 From: Chris Paul Date: Thu, 6 Oct 2016 17:04:48 -0700 Subject: [PATCH 3/5] Update javascript.vim --- indent/javascript.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indent/javascript.vim b/indent/javascript.vim index bc5932e6..d5d359cb 100644 --- a/indent/javascript.vim +++ b/indent/javascript.vim @@ -218,7 +218,7 @@ function GetJavascriptIndent() let b:js_cache = [v:lnum,num,line('.') == v:lnum ? b:js_cache[2] : col('.')] call cursor(v:lnum,1) - if l:line =~# '^while\>' && s:GetPair(s:line_pre . '\C\','\C\','bW',s:skip_expr,100,num) > 0 + if l:line =~# '^while\>' && s:GetPair(s:line_pre . '\C\','\C\','bW',s:skip_expr,100,num + 1) > 0 return indent(line('.')) endif From 285bc33597d211495957abe33c23ebe716c51fab Mon Sep 17 00:00:00 2001 From: Chris Paul Date: Thu, 6 Oct 2016 20:22:53 -0700 Subject: [PATCH 4/5] Update javascript.vim --- indent/javascript.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indent/javascript.vim b/indent/javascript.vim index d5d359cb..0fc654e7 100644 --- a/indent/javascript.vim +++ b/indent/javascript.vim @@ -96,7 +96,7 @@ function s:iscontOne(i,num,cont) while l:i >= l:num && (!l:cont || ind > pind + s:W) if indent(l:i) < ind " first line always true for !a:cont, false for !!a:cont if s:OneScope(l:i,s:Trimline(l:i)) - if expand('') ==# 'while' && s:GetPair(s:line_pre . '\C\','\C\','bW',s:skip_expr,100,l:num) > 0 + if expand('') ==# 'while' && s:GetPair(s:line_pre . '\C\','\C\','bW',s:skip_expr,100,l:num + !!a:num) > 0 return 0 endif let bL += 1 From 14c3c5b518227df9a190d2b31d53bfba7c4d1cfe Mon Sep 17 00:00:00 2001 From: Chris Paul Date: Thu, 6 Oct 2016 21:11:25 -0700 Subject: [PATCH 5/5] Update javascript.vim --- indent/javascript.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indent/javascript.vim b/indent/javascript.vim index 0fc654e7..e5c57496 100644 --- a/indent/javascript.vim +++ b/indent/javascript.vim @@ -155,8 +155,8 @@ endfunction function GetJavascriptIndent() try - let save_magic = &magic - set magic + let save_magic = &magic + set magic if !exists('b:js_cache') let b:js_cache = [0,0,0] endif