From 3cb44a8ba588e1ada409af495bdc6a4d2d37d5da Mon Sep 17 00:00:00 2001 From: Mo-tmd <136635201+Mo-tmd@users.noreply.github.com> Date: Wed, 16 Apr 2025 00:58:52 +0200 Subject: [PATCH] Add workaround for `normal!` bug in nvim terminals (#1588) There's a known issue regarding `normal` usage in neovim. See https://github.com/neovim/neovim/issues/4895 for more details. As a temporary workaround, use setpos to set the bookmark instead. --- autoload/fzf/vim.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/fzf/vim.vim b/autoload/fzf/vim.vim index 8c8351c..e2af9d0 100755 --- a/autoload/fzf/vim.vim +++ b/autoload/fzf/vim.vim @@ -369,7 +369,7 @@ function! s:action_for(key, ...) " errors. e.g. E471: Argument required: tab drop if !a:0 if !edit - normal! m' + call setpos("''", getpos('.')) silent! call s:execute_silent(cmd) endif else @@ -378,7 +378,7 @@ function! s:action_for(key, ...) " instructed to stay on the current buffer. let stay = edit && (a:0 > 1 && a:2 || fnamemodify(a:1, ':p') ==# expand('%:p')) if !stay - normal! m' + call setpos("''", getpos('.')) call s:execute_silent((len(cmd) ? cmd : 'edit').' '.s:escape(a:1)) endif endif