mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-06 18:54:27 +08:00
fixed comment block.
This commit is contained in:
@@ -1276,25 +1276,25 @@ endfunction
|
|||||||
|
|
||||||
function! s:zen_toggleComment()
|
function! s:zen_toggleComment()
|
||||||
let pos = getpos('.')
|
let pos = getpos('.')
|
||||||
let sp1 = searchpos('<', 'bnW')
|
let sp1 = searchpos('<[^!]', 'bnW')
|
||||||
let sp2 = searchpos('>', 'bnW')
|
let sp2 = searchpos('>', 'bnW')
|
||||||
if sp1[0]<sp2[0] || (sp1[0] == sp2[0] && sp1[1]<sp2[1])
|
if sp1[0]<sp2[0] || (sp1[0] == sp2[0] && sp1[1]<sp2[1])
|
||||||
if searchpair('<!-- ', '', ' -->', 'bcW')
|
if searchpair('<!-- ', '', ' -->', 'bcW')
|
||||||
exe "normal! d5l"
|
exe "normal! d5l"
|
||||||
call search(' -->', 'ceW')
|
call search(' -->', 'cW')
|
||||||
exe "normal! d4h"
|
exe "normal! d4l"
|
||||||
let pos[2] -= 5
|
let pos[2] -= 5
|
||||||
elseif searchpair('[^\s]', '', '[^\s]', 'bcW')
|
elseif searchpair('>', '', '<', 'bcW')
|
||||||
exe "normal! Bi<!--"
|
exe "normal! a<!-- "
|
||||||
call search('\(\s\|$\)', 'eW')
|
call search('<', 'ceW')
|
||||||
exe "normal! a--\<c-v>>"
|
exe "normal! i --\<c-v>>"
|
||||||
let pos[2] += 4
|
let pos[2] += 5
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
call search('<', 'bW')
|
call search('<', 'bW')
|
||||||
if searchpair('<!-- <[a-z]', '', ' -->', 'bcW')
|
if searchpair('<!-- <[a-z]', '', ' -->', 'bcW')
|
||||||
exe "normal! d5l"
|
exe "normal! d5l"
|
||||||
call search('\(</[^>]\+>\|<[^/>]\+/>\) -->', 'ceW')
|
call search(' -->', 'ceW')
|
||||||
exe "normal! d4h"
|
exe "normal! d4h"
|
||||||
let pos[2] -= 5
|
let pos[2] -= 5
|
||||||
elseif searchpair('<[a-z]', '', '\(</[^>]\+>\|<[^/>]\+/>\)', 'bcW')
|
elseif searchpair('<[a-z]', '', '\(</[^>]\+>\|<[^/>]\+/>\)', 'bcW')
|
||||||
|
|||||||
Reference in New Issue
Block a user