forked from VimPlug/emmet-vim
Save/restore cursor position for removing $cursor$. related issue #162
This commit is contained in:
@@ -643,16 +643,15 @@ function! emmet#expandAbbr(mode, abbr) range
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
if search('\$cursor\$', 'e')
|
if search('\ze\$cursor\$', 'e')
|
||||||
let oldselection = &selection
|
let oldselection = &selection
|
||||||
let &selection = 'inclusive'
|
let &selection = 'inclusive'
|
||||||
if foldclosed(line('.')) != -1
|
if foldclosed(line('.')) != -1
|
||||||
silent! foldopen
|
silent! foldopen
|
||||||
endif
|
endif
|
||||||
silent! exe "normal! v7h\"_s"
|
let pos = emmet#util#getcurpos()
|
||||||
if col('.') == col('$')
|
silent! s/\$cursor\$//
|
||||||
call feedkeys('', 'n')
|
silent! call setpos('.', pos)
|
||||||
endif
|
|
||||||
let &selection = oldselection
|
let &selection = oldselection
|
||||||
endif
|
endif
|
||||||
if g:emmet_debug > 1
|
if g:emmet_debug > 1
|
||||||
|
|||||||
Reference in New Issue
Block a user