From 8c2a246bee6e3c71dd63536840ebc4eb107a4c5f Mon Sep 17 00:00:00 2001 From: mattn Date: Tue, 16 Mar 2010 16:47:21 +0900 Subject: [PATCH] css comment. --- zencoding.vim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/zencoding.vim b/zencoding.vim index 43b4ad7..17f74a3 100644 --- a/zencoding.vim +++ b/zencoding.vim @@ -1483,6 +1483,21 @@ EOF endfunction function! s:zen_toggleComment() + if s:zen_getFileType() == 'css' + let line = getline('.') + let mx = '^\(\s*\)/\*\s*\(.*\)\s*\*/\s*$' + if line =~ mx + let space = substitute(matchstr(line, mx), mx, '\1', '') + let line = substitute(matchstr(line, mx), mx, '\2', '') + let line = space . substitute(line, '^\s*\|\s*$', '\1', 'g') + else + let mx = '^\(\s*\)\(.*\)\s*$' + let line = substitute(line, mx, '\1/* \2 */', '') + endif + call setline('.', line) + return + endif + let curpos = getpos('.') while 1 let mx = '<\(/\{0,1}[a-zA-Z][a-zA-Z0-9]*\)[^>]*>'