File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ let s:empty_tagname = '(area|base|br|col|embed|hr|input|img|keygen|link|meta|par
2626let s: empty_tag = ' \v\C\<' .s: empty_tagname .' [^/]*\>'
2727let s: empty_tag_start = ' \v\<' .s: empty_tagname .' [^\>]*$'
2828let s: empty_tag_end = ' \v^\s*[^\<\>\/]*\>\s*'
29+ let s: tag_start = ' ^<$'
2930let s: tag_end = ' \v^\s*\/?\>\s*'
3031let s: oneline_block = ' ^\s*{#.*{/.*}\s*$'
3132" }}}
@@ -170,6 +171,9 @@ function! GetSvelteIndent()
170171 elseif s: SynStyle (cursyn)
171172 call s: Log (' syntax: style' )
172173 let ind = GetCSSIndent ()
174+ elseif s: IsTagStart (curline)
175+ call s: Log (' syntax: tagstart' )
176+ let ind = 0
173177 else
174178 call s: Log (' syntax: javascript' )
175179 if len (b: javascript_indentexpr )
@@ -199,6 +203,10 @@ function! GetSvelteIndent()
199203 return ind
200204endfunction
201205
206+ function ! s: IsTagStart (curline)
207+ return a: curline = ~ s: tag_start
208+ endfunction
209+
202210function ! s: IsBlockStart (prevsyns)
203211 let prevsyn_second = get (a: prevsyns , 1 , ' ' )
204212 " Some HTML tags add an extra syntax layer
You can’t perform that action at this time.
0 commit comments