Skip to content

Commit

Permalink
Fix #77 find start tag and find end tag supports custom element
Browse files Browse the repository at this point in the history
  • Loading branch information
othree committed Mar 8, 2018
1 parent fe3501f commit ab907f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions indent/html.vim
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ func! HtmlIndent_FindStartTag()
" The cursor must be on or before a closing tag.
" If found, positions the cursor at the match and returns the line number.
" Otherwise returns 0.
let tagname = matchstr(getline('.')[col('.') - 1:], '</\zs\w\+\ze')
let tagname = matchstr(getline('.')[col('.') - 1:], '</\zs\w\+\(-\w\+\)*\ze')
let start_lnum = searchpair('<' . tagname . '\>', '', '</' . tagname . '\>', 'bW')
if start_lnum > 0
return start_lnum
Expand All @@ -876,7 +876,7 @@ func! HtmlIndent_FindTagEnd()
" a self-closing tag, to the matching ">".
" Limited to look up to b:html_indent_line_limit lines away.
let text = getline('.')
let tagname = matchstr(text, '\w\+\|!--', col('.'))
let tagname = matchstr(text, '\w\+\(-\w\+\)*\|!--', col('.'))
if tagname == '!--'
call search('--\zs>')
elseif s:get_tag('/' . tagname) != 0
Expand Down

0 comments on commit ab907f3

Please sign in to comment.