Skip to content

Commit 206b85c

Browse files
committed
literal indentation in a multiline string (#430)
1 parent a6e90ba commit 206b85c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

indent/javascript.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,11 @@ function GetJavascriptIndent()
340340
let line = getline(v:lnum)
341341
" previous nonblank line number
342342
let prevline = prevnonblank(v:lnum - 1)
343+
344+
" to not change multiline string values
345+
if (synIDattr(synID(v:lnum, 1, 1), 'name') =~? 'string' || s:IsInTempl(v:lnum, 1)) && line !~ '^\s*[''"`]'
346+
return
347+
endif
343348

344349
" If we are in a multi-line comment, cindent does the right thing.
345350
if s:IsInMultilineComment(v:lnum, 1) && !s:IsLineComment(v:lnum, 1)

0 commit comments

Comments
 (0)