-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Options altered in Vim window after using popup #2041
Comments
The issue comes from here: Lines 838 to 844 in d631c76
In the past, Line 683 in d631c76
Line 755 in d631c76
But now, the popup is created later, once the terminal buffer is created: Line 852 in d631c76
So the settings are applied in the wrong window. I'm going to look for a fix. I wonder whether it makes sense to set |
If I'm right, and diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index c288948..1bbb4f5 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -680,7 +680,9 @@ function! s:split(dict)
endif
return [ppos, { '&l:wfw': &l:wfw, '&l:wfh': &l:wfh }, is_popup]
finally
- setlocal winfixwidth winfixheight
+ if !is_popup
+ setlocal winfixwidth winfixheight
+ endif
endtry
endfunction
@@ -751,9 +753,6 @@ function! s:execute_term(dict, command, temps) abort
if has('nvim')
call termopen(command, fzf)
else
- if !len(&bufhidden)
- setlocal bufhidden=hide
- endif
let term_opts = {'exit_cb': function(fzf.on_exit)}
if is_popup
let term_opts.hidden = 1 It also gets rid of |
man fzf
)Info
Problem / Steps to reproduce
After using fzf in a Vim popup window, the options
'bufhidden'
,'winfixwidth'
,'winfixheight'
are not properly restored. This can cause unexpected behaviors. For example, the focused window is sometimes wrongly restored when quitting a window.To Reproduce
Run this shell command:
Run this Ex command:
Press Escape to quit the fzf popup, and run these Ex commands:
Vim focuses the window 1. This is wrong; it should focus the window 2.
I think that's because the option
'winfixheight'
has been wrongly set in the window 2.Opening the fzf popup also causes
'winfixwidth'
to be set, and'bufhidden'
to be set tohide
in the current Vim window.Expected behavior
The options
'winfixwidth'
,'winfixheight'
and'bufhidden'
are not altered in the current Vim window after using the fzf popup.Screenshots
Environment
Additional context
This is a regression introduced in d631c76.
/cc @ichizok
The text was updated successfully, but these errors were encountered: