Skip to content

Commit 5d8153e

Browse files
authored
string match
overkill using strridx
1 parent dc34b24 commit 5d8153e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

indent/javascript.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ function GetJavascriptIndent()
255255
" most significant, find the indent amount
256256
let isOp = l:line =~# s:opfirst || pline !~# s:expr_case . '$' && pline =~# s:continuation
257257
let bL = s:iscontOne(l:lnum,num,isOp)
258-
let bL -= (bL && strridx(l:line,'{',0) + 1) * s:W
258+
let bL -= (bL && l:line[0] == '{') * s:W
259259
if isOp && (!num || bchar && cursor(b:js_cache[1],b:js_cache[2])+1 && s:IsBlock())
260260
return (num ? indent(num) : -s:W) + (s:W * 2) + switch_offset + bL
261261
elseif num

0 commit comments

Comments
 (0)