We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce7c06c commit 5453eb0Copy full SHA for 5453eb0
indent/javascript.vim
@@ -159,13 +159,15 @@ function GetJavascriptIndent()
159
let syns = synIDattr(synID(v:lnum, 1, 0), 'name')
160
161
" start with strings,comments,etc.
162
- if l:line !~ '^[''"]' && syns =~? '\%(string\|template\)' ||
163
- \ l:line !~ '^\s*[/*]' && syns =~? s:syng_comment
+ if syns =~? s:syng_comment
+ if l:line =~ '^\s*\*'
164
+ return cindent(v:lnum)
165
+ elseif l:line !~ '^\s*\/'
166
+ return -1
167
+ endif
168
+ elseif syns =~? '\%(string\|template\)' && l:line !~ '^[''"]'
169
return -1
170
endif
- if l:line =~ '^\s*\*' && syns =~? s:syng_comment
- return cindent(v:lnum)
- endif
171
let l:lnum = s:PrevCodeLine(v:lnum - 1)
172
if l:lnum == 0
173
return 0
0 commit comments