mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
fix: use normal!
Use command normal! to avoid any mapping being accidentally used.
This commit is contained in:
parent
9c434b472e
commit
764bd0c2bb
@ -117,18 +117,18 @@ function! utils#MoveSelection(direction) abort
|
|||||||
if a:direction ==# 'up'
|
if a:direction ==# 'up'
|
||||||
if l:start_line == 1
|
if l:start_line == 1
|
||||||
" we can also directly use `normal gv`, see https://stackoverflow.com/q/9724123/6064933
|
" we can also directly use `normal gv`, see https://stackoverflow.com/q/9724123/6064933
|
||||||
normal gv
|
normal! gv
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
silent execute printf('%s,%smove-2', l:start_line, l:end_line)
|
silent execute printf('%s,%smove-2', l:start_line, l:end_line)
|
||||||
normal gv
|
normal! gv
|
||||||
elseif a:direction ==# 'down'
|
elseif a:direction ==# 'down'
|
||||||
if l:end_line == line('$')
|
if l:end_line == line('$')
|
||||||
normal gv
|
normal! gv
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
silent execute printf('%s,%smove+%s', l:start_line, l:end_line, l:num_line)
|
silent execute printf('%s,%smove+%s', l:start_line, l:end_line, l:num_line)
|
||||||
normal gv
|
normal! gv
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user