Skip to content

Commit 73f3d0f

Browse files
authored
don't move cursor to find case statement (#1097)
1 parent 4458186 commit 73f3d0f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

indent/javascript.vim

+2-2
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ function s:IsContOne(cont)
314314
endfunction
315315

316316
function s:IsSwitch()
317-
call call('cursor',b:js_cache[1:])
318-
return search('\m\C\%#.\_s*\%(\%(\/\/.*\_$\|\/\*\_.\{-}\*\/\)\@>\_s*\)*\%(case\|default\)\>','nWc'.s:z)
317+
return search('\m\C\%'.join(b:js_cache[1:],'l\%').
318+
\ 'c{\_s*\%(\%(\/\/.*\_$\|\/\*\_.\{-}\*\/\)\@>\_s*\)*\%(case\|default\)\>','nW'.s:z)
319319
endfunction
320320

321321
" https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader

0 commit comments

Comments
 (0)