We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6ccc1a7 commit 8ea46f3Copy full SHA for 8ea46f3
1 file changed
indent/javascript.vim
@@ -258,17 +258,12 @@ function s:PrevCodeLine(lnum)
258
let l:pos = getpos('.')
259
call cursor(l:n,1)
260
let l:n = search('\m\/\*','bW')
261
- try
262
- while search('\m\/\*\|\(\*\/\)','bWp') == 1
263
- for l:i in range(l:n,line('.'),-1)
264
- if s:SynAt(l:i,l:i == line('.') ? col('.') : 1) !~? s:syng_com
265
- throw 'to main loop'
266
- endif
267
- endfor
268
- let l:n = line('.')
269
- endwhile
270
- catch
271
- endtry
+ while l:n == line('.') && search('\m\/\*\|\(\*\/\)','bWp') == 1
+ " /*\n/*\n */ comment region
+ let l:n = filter(range(l:n, line('.'), -1),
+ \ 'v:val == line(".") || !empty(getline(v:val)) &&'.
+ \ 's:SynAt(v:val,1) !~? s:syng_com && {}')[0]
+ endwhile
272
call setpos('.',l:pos)
273
else
274
break
0 commit comments