Fix next item in CSS

This commit is contained in:
Yasuhiro Matsumoto
2019-06-24 23:20:54 +09:00
parent 5a7c7930c6
commit f4afd031a3
2 changed files with 6 additions and 9 deletions

View File

@@ -380,7 +380,7 @@ function! emmet#getFileType(...) abort
endif endif
let pos = emmet#util#getcurpos() let pos = emmet#util#getcurpos()
let type = synIDattr(synID(pos[1], pos[2], 1), 'name') let type = synIDattr(synID(max([pos[1], 1]), max([pos[2], 1]), 1), 'name')
" ignore htmlTagName as it seems to occur too often " ignore htmlTagName as it seems to occur too often
if type == 'htmlTagName' if type == 'htmlTagName'

View File

@@ -296,7 +296,9 @@ function! emmet#lang#css#toggleComment() abort
let line = substitute(matchstr(line, mx), mx, '\2', '') let line = substitute(matchstr(line, mx), mx, '\2', '')
let line = space . substitute(line, '^\s*\|\s*$', '\1', 'g') let line = space . substitute(line, '^\s*\|\s*$', '\1', 'g')
else else
let mx = '^\(\s*\)\(.*\)\s*$' let mx = '^\(\s*\)\(''[^'']*''\|[^'']*\|;\)\s*$'
" TODO multi-property
"let mx = '^\(\s*\)\(\%(''[^'']*''\|[^'';]\+\)*;\{0,1}\)'
let line = substitute(line, mx, '\1/* \2 */', '') let line = substitute(line, mx, '\1/* \2 */', '')
endif endif
call setline('.', line) call setline('.', line)
@@ -352,13 +354,8 @@ function! emmet#lang#css#moveNextPrevItem(flag) abort
endfunction endfunction
function! emmet#lang#css#moveNextPrev(flag) abort function! emmet#lang#css#moveNextPrev(flag) abort
let pos = search('""\|()\|\(:\s*\zs$\)', a:flag ? 'Wbp' : 'Wp') call search('""\|()\|\(:\s*\zs;\{1,0}$\)', a:flag ? 'Wbp' : 'Wp')
if pos == 2 return ''
startinsert!
else
silent! normal! l
startinsert
endif
endfunction endfunction
function! emmet#lang#css#splitJoinTag() abort function! emmet#lang#css#splitJoinTag() abort