mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-09 20:14:55 +08:00
fix toggleComment for css.
This commit is contained in:
@@ -63,6 +63,19 @@ endfunction
|
|||||||
function! zencoding#lang#css#toggleComment()
|
function! zencoding#lang#css#toggleComment()
|
||||||
let line = getline('.')
|
let line = getline('.')
|
||||||
let mx = '^\(\s*\)/\*\s*\(.*\)\s*\*/\s*$'
|
let mx = '^\(\s*\)/\*\s*\(.*\)\s*\*/\s*$'
|
||||||
|
if line =~ '{\s*$'
|
||||||
|
let block = zencoding#util#searchRegion('/\*', '\*/\zs')
|
||||||
|
if zencoding#util#regionIsValid(block)
|
||||||
|
let content = zencoding#util#getContent(block)
|
||||||
|
let content = substitute(content, '/\*\s\(.*\)\s\*/', '\1', '')
|
||||||
|
call zencoding#util#setContent(block, content)
|
||||||
|
else
|
||||||
|
let node = expand('<cword>')
|
||||||
|
if len(node)
|
||||||
|
exe "normal ciw\<c-r>='/* '.node.' */'\<cr>"
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
else
|
||||||
if line =~ mx
|
if line =~ mx
|
||||||
let space = substitute(matchstr(line, mx), mx, '\1', '')
|
let space = substitute(matchstr(line, mx), mx, '\1', '')
|
||||||
let line = substitute(matchstr(line, mx), mx, '\2', '')
|
let line = substitute(matchstr(line, mx), mx, '\2', '')
|
||||||
@@ -72,4 +85,5 @@ function! zencoding#lang#css#toggleComment()
|
|||||||
let line = substitute(line, mx, '\1/* \2 */', '')
|
let line = substitute(line, mx, '\1/* \2 */', '')
|
||||||
endif
|
endif
|
||||||
call setline('.', line)
|
call setline('.', line)
|
||||||
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
Reference in New Issue
Block a user