mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-06 18:54:27 +08:00
Fix next item in CSS
This commit is contained in:
@@ -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'
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user