mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 17:40:06 +08:00
fix(iedit): skip empty character when start iedit
if the cursor in on empty character, iedit should be skipped
This commit is contained in:
parent
c8cc8c0332
commit
c63e9bf303
@ -97,6 +97,16 @@ endfunction
|
|||||||
" <
|
" <
|
||||||
" if only argv 1 is given, use selected word as pattern
|
" if only argv 1 is given, use selected word as pattern
|
||||||
function! SpaceVim#plugins#iedit#start(...) abort
|
function! SpaceVim#plugins#iedit#start(...) abort
|
||||||
|
" do not start iedit if symbol is empty
|
||||||
|
let argv = get(a:000, 0, '')
|
||||||
|
if empty(argv) &&
|
||||||
|
\ (
|
||||||
|
\ matchstr(getline('.'), '\%' . col('.') . 'c.') ==# ''
|
||||||
|
\ || matchstr(getline('.'), '\%' . col('.') . 'c.') ==# ' '
|
||||||
|
\ )
|
||||||
|
echo 'no pattern found under cursor'
|
||||||
|
return
|
||||||
|
endif
|
||||||
let save_tve = &t_ve
|
let save_tve = &t_ve
|
||||||
let save_cl = &l:cursorline
|
let save_cl = &l:cursorline
|
||||||
setlocal nocursorline
|
setlocal nocursorline
|
||||||
@ -108,7 +118,6 @@ function! SpaceVim#plugins#iedit#start(...) abort
|
|||||||
let w:spacevim_statusline_mode = 'in'
|
let w:spacevim_statusline_mode = 'in'
|
||||||
if empty(s:stack)
|
if empty(s:stack)
|
||||||
let curpos = getpos('.')
|
let curpos = getpos('.')
|
||||||
let argv = get(a:000, 0, '')
|
|
||||||
let save_reg_k = @k
|
let save_reg_k = @k
|
||||||
" the register " is cleared
|
" the register " is cleared
|
||||||
" save the register context before run following command
|
" save the register context before run following command
|
||||||
|
Loading…
Reference in New Issue
Block a user