Skip to content
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

Globally disabling previews doesn't affect :GFiles? #1010

Closed
4 tasks done
jesseleite opened this issue May 4, 2020 · 4 comments
Closed
4 tasks done

Globally disabling previews doesn't affect :GFiles? #1010

jesseleite opened this issue May 4, 2020 · 4 comments

Comments

@jesseleite
Copy link
Contributor

Globally disabling previews doesn't seem to affect :GFiles?

let g:fzf_preview_window = ''

image

@yujinyuz
Copy link

It seems to be working fine for me

@jesseleite
Copy link
Contributor Author

Something I've noticed... let g:fzf_preview_window = '' in vim seems to disable the preview fine, IF I export global preview window settings for fzf like this in my .zshrc:

export FZF_DEFAULT_OPTS='--preview-window right:50%:noborder:hidden --color "preview-bg:234" --bind "alt-p:toggle-preview"'

However without that zsh export, let g:fzf_preview_window = '' does nothing in vim. Not sure why this is the case 🤔

@Frederick888
Copy link
Contributor

Frederick888 commented Sep 2, 2020

I can confirm this issue using NeoVim 0.4.4, Zsh 5.8.

Without FZF_DEFAULT_OPTS, g:fzf_preview_window still works but only for some of the commands, e.g. Files, Rg, Buffers, GFiles, etc. GFiles?, Commits, BCommits just always place preview window on the right (which iirc is the default).

With FZF_DEFAULT_OPTS, g:fzf_preview_window still has no effect on GFiles?, Commits or BCommits and they always follow the environment variable.

PS: I do like the fact that Commits and BCommits always place preview on the right though. Only GFiles? bothers me.

@Frederick888
Copy link
Contributor

I think the problem (at least in the case of GFiles?) is that s:p() in plugin/fzf.vim, where g:fzf_preview_window is processed, is not used in some cases, e.g.

\'command! -bang -nargs=? GFiles call fzf#vim#gitfiles(<q-args>, <q-args> == "?" ? {} : s:p(<bang>0), <bang>0)',

...when <q-args> == "?", an empty {} is used as extra options later in s:fzf().

cpkio pushed a commit to cpkio/fzf_windows.vim that referenced this issue Oct 22, 2020
- The default preview window option will be ['right', 'ctrl-/']
  regardless of screen width or <bang>
- This will also fix junegunn#1010
cpkio pushed a commit to cpkio/fzf_windows.vim that referenced this issue Oct 22, 2020
- The default preview window option will be ['right', 'ctrl-/']
  regardless of screen width or <bang>
- This will also fix junegunn#1010
antoinemadec pushed a commit to antoinemadec/fzf.vim that referenced this issue Feb 28, 2021
- The default preview window option will be ['right', 'ctrl-/']
  regardless of screen width or <bang>
- This will also fix junegunn#1010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants