mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-07 03:04:27 +08:00
Fix hang-up while split/join tag
This commit is contained in:
@@ -386,6 +386,9 @@ function! emmet#getFileType(...) abort
|
||||
if type == 'htmlTagName'
|
||||
let type = ''
|
||||
endif
|
||||
if type =~ '^mkdSnippet'
|
||||
let type = tolower(type[10:])
|
||||
endif
|
||||
|
||||
if type =~? '^css'
|
||||
let type = 'css'
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user