1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-24 05:30:07 +08:00

Support visual mode iedit

This commit is contained in:
wsdjeg 2018-01-12 22:50:38 +08:00
parent 3d34132df6
commit 64e9ec317a

View File

@ -51,18 +51,16 @@ function! SpaceVim#plugins#iedit#start(...)
let s:mode = 'n' let s:mode = 'n'
let w:spacevim_iedit_mode = s:mode let w:spacevim_iedit_mode = s:mode
let w:spacevim_statusline_mode = 'in' let w:spacevim_statusline_mode = 'in'
if get(a:000, 1, 0) == 1 if get(a:000, 0, 0) == 1
if a:firstline == a:lastline
let save_reg_k = @k let save_reg_k = @k
normal! gv"ky normal! gv"ky
let symbol = @k let symbol = split(@k, "\n")[0]
let @k = save_reg_k let @k = save_reg_k
else else
let symbol = expand('<cword>') let symbol = expand('<cword>')
endif endif
else echomsg string(a:000)
let symbol = expand('<cword>') echom symbol
endif
let begin = get(a:000, 1, 1) let begin = get(a:000, 1, 1)
let end = get(a:000, 2, line('$')) let end = get(a:000, 2, line('$'))
call s:parse_symbol(begin, end, symbol) call s:parse_symbol(begin, end, symbol)