Skip to content

Commit ab907f3

Browse files
committed
Fix #77 find start tag and find end tag supports custom element
1 parent fe3501f commit ab907f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

indent/html.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ func! HtmlIndent_FindStartTag()
860860
" The cursor must be on or before a closing tag.
861861
" If found, positions the cursor at the match and returns the line number.
862862
" Otherwise returns 0.
863-
let tagname = matchstr(getline('.')[col('.') - 1:], '</\zs\w\+\ze')
863+
let tagname = matchstr(getline('.')[col('.') - 1:], '</\zs\w\+\(-\w\+\)*\ze')
864864
let start_lnum = searchpair('<' . tagname . '\>', '', '</' . tagname . '\>', 'bW')
865865
if start_lnum > 0
866866
return start_lnum
@@ -876,7 +876,7 @@ func! HtmlIndent_FindTagEnd()
876876
" a self-closing tag, to the matching ">".
877877
" Limited to look up to b:html_indent_line_limit lines away.
878878
let text = getline('.')
879-
let tagname = matchstr(text, '\w\+\|!--', col('.'))
879+
let tagname = matchstr(text, '\w\+\(-\w\+\)*\|!--', col('.'))
880880
if tagname == '!--'
881881
call search('--\zs>')
882882
elseif s:get_tag('/' . tagname) != 0

0 commit comments

Comments
 (0)