mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-09 20:14:55 +08:00
fix #287. set nogdefault
This commit is contained in:
@@ -682,20 +682,26 @@ function! emmet#expandAbbr(mode, abbr) range abort
|
|||||||
endif
|
endif
|
||||||
let pos = emmet#util#getcurpos()
|
let pos = emmet#util#getcurpos()
|
||||||
let use_selection = emmet#getResource(type, 'use_selection', 0)
|
let use_selection = emmet#getResource(type, 'use_selection', 0)
|
||||||
if use_selection && getline('.')[col('.')-1:] =~# '^\$select'
|
try
|
||||||
let pos[2] += 1
|
let l:gdefault = &gdefault
|
||||||
silent! s/\$select\$//
|
let &gdefault = 0
|
||||||
let next = searchpos('.\ze\$select\$', 'nW')
|
if use_selection && getline('.')[col('.')-1:] =~# '^\$select'
|
||||||
silent! %s/\$\(cursor\|select\)\$//g
|
let pos[2] += 1
|
||||||
call emmet#util#selectRegion([pos[1:2], next])
|
silent! s/\$select\$//
|
||||||
return "\<esc>gv"
|
let next = searchpos('.\ze\$select\$', 'nW')
|
||||||
else
|
silent! %s/\$\(cursor\|select\)\$//g
|
||||||
silent! %s/\$\(cursor\|select\)\$//g
|
call emmet#util#selectRegion([pos[1:2], next])
|
||||||
silent! call setpos('.', pos)
|
return "\<esc>gv"
|
||||||
if col('.') < col('$')
|
else
|
||||||
return "\<right>"
|
silent! %s/\$\(cursor\|select\)\$//g
|
||||||
|
silent! call setpos('.', pos)
|
||||||
|
if col('.') < col('$')
|
||||||
|
return "\<right>"
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
finally
|
||||||
|
let &gdefault = l:gdefault
|
||||||
|
endtry
|
||||||
let &selection = oldselection
|
let &selection = oldselection
|
||||||
endif
|
endif
|
||||||
return ''
|
return ''
|
||||||
|
|||||||
Reference in New Issue
Block a user