We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c03aee7 commit 3ea6ed6Copy full SHA for 3ea6ed6
1 file changed
indent/javascript.vim
@@ -241,14 +241,11 @@ function s:Continues(ln,con)
241
endfunction
242
243
function s:Trim(ln)
244
- let pline = substitute(getline(a:ln),'\s*$','','')
245
- let l:max = max([strridx(pline,'//'), strridx(pline,'/*')])
246
- while l:max != -1 && s:SynAt(a:ln, strlen(pline)) =~? s:syng_com
247
- let pline = pline[: l:max]
248
249
- let pline = substitute(pline[:-2],'\s*$','','')
+ let divi = split(getline(a:ln),'\s\+$\|\S\zs\ze\s*\/[/*]')
+ while len(divi) > 1 && s:SynAt(a:ln, strlen(join(divi,''))) =~? s:syng_com
+ call remove(divi,-1)
250
endwhile
251
- return pline
+ return join(divi,'')
252
253
254
" Find line above 'lnum' that isn't empty or in a comment
0 commit comments