This commit is contained in:
mattn
2010-08-02 15:31:03 +09:00
parent c623a72a39
commit 2d9d13e4bd

View File

@@ -1615,7 +1615,7 @@ function! s:zen_toggleComment()
let block = [pos1, [pos1[0], pos1[1] + len(content) - 1]]
if content[-2:] == '/>' && s:point_in_region(curpos[1:2], block)
let comment_region = s:search_region('<!--', '-->')
if !s:region_is_valid(comment_region) || !s:point_in_region(curpos[1:2], comment_region) || !s:point_in_region(comment_region[0], block)
if !s:region_is_valid(comment_region) || !s:point_in_region(curpos[1:2], comment_region) || !(s:point_in_region(comment_region[0], block) && s:point_in_region(comment_region[1], block))
let content = '<!-- ' . s:get_content(block) . ' -->'
call s:change_content(block, content)
else
@@ -1642,13 +1642,13 @@ function! s:zen_toggleComment()
endif
if s:point_in_region(curpos[1:2], block)
let comment_region = s:search_region('<!--', '-->')
if !s:region_is_valid(comment_region) || !s:point_in_region(curpos[1:2], comment_region)
if !s:region_is_valid(comment_region) || !s:point_in_region(curpos[1:2], comment_region) || !(s:point_in_region(comment_region[0], block) && s:point_in_region(comment_region[1], block))
let content = '<!-- ' . s:get_content(block) . ' -->'
call s:change_content(block, content)
else
let content = s:get_content(block)
let content = s:get_content(comment_region)
let content = substitute(content, '^<!--\s\(.*\)\s-->$', '\1', '')
call s:change_content(block, content)
call s:change_content(comment_region, content)
endif
return
else