1
0
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:
jdhao 2021-07-13 22:42:40 +08:00
parent 9c434b472e
commit 764bd0c2bb

View File

@ -117,18 +117,18 @@ function! utils#MoveSelection(direction) abort
if a:direction ==# 'up'
if l:start_line == 1
" we can also directly use `normal gv`, see https://stackoverflow.com/q/9724123/6064933
normal gv
normal! gv
return
endif
silent execute printf('%s,%smove-2', l:start_line, l:end_line)
normal gv
normal! gv
elseif a:direction ==# 'down'
if l:end_line == line('$')
normal gv
normal! gv
return
endif
silent execute printf('%s,%smove+%s', l:start_line, l:end_line, l:num_line)
normal gv
normal! gv
endif
endfunction