Fix hang-up while split/join tag

This commit is contained in:
Yasuhiro Matsumoto
2019-06-19 00:46:33 +09:00
parent d02023cd7a
commit 50b44d90c9
2 changed files with 9 additions and 1 deletions

View File

@@ -894,8 +894,9 @@ endfunction
function! emmet#lang#html#splitJoinTag() abort
let curpos = emmet#util#getcurpos()
let mx = '<\(/\{0,1}[a-zA-Z][-a-zA-Z0-9:_\-]*\)\%(\%(\s[a-zA-Z][a-zA-Z0-9]\+=\%([^"'' \t]\+\|"[^"]\{-}"\|''[^'']\{-}''\)\s*\)*\)\s*\%(/\{0,1}\)>'
while 1
let mx = '<\(/\{0,1}[a-zA-Z][-a-zA-Z0-9:_\-]*\)\%(\%(\s[a-zA-Z][a-zA-Z0-9]\+=\%([^"'' \t]\+\|"[^"]\{-}"\|''[^'']\{-}''\)\s*\)*\)\%(/\{0,1}\)>'
let old = getpos('.')[1:2]
let pos1 = searchpos(mx, 'bcnW')
let content = matchstr(getline(pos1[0])[pos1[1]-1:], mx)
let tag_name = substitute(content, '^<\(/\{0,1}[a-zA-Z][a-zA-Z0-9:_\-]*\).*$', '\1', '')
@@ -927,6 +928,10 @@ function! emmet#lang#html#splitJoinTag() abort
call setpos('.', curpos)
return
endif
if pos1 == old
call setpos('.', curpos)
return
endif
endif
endif
endwhile