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

Alternative layout cannot be toggled if hidden by default #3113

Closed
6 of 10 tasks
MaienM opened this issue Jan 5, 2023 · 0 comments
Closed
6 of 10 tasks

Alternative layout cannot be toggled if hidden by default #3113

MaienM opened this issue Jan 5, 2023 · 0 comments
Labels

Comments

@MaienM
Copy link

MaienM commented Jan 5, 2023

  • I have read through the manual page (man fzf)
  • I have the latest version of fzf
  • I have searched through the existing issues

Info

  • OS
    • Linux
    • Mac OS X
    • Windows
    • Etc.
  • Shell
    • bash
    • zsh
    • fish

Problem / Steps to reproduce

An alternative layout in the preview window that is hidden by default cannot be toggled using the toggle-preview binding.

fzf --bind 'ctrl-p:toggle-preview' --preview 'stat {}' --preview-window='right,50%,<100(down,50%,hidden)'

If run in a large enough window that the regular layout is used toggling the preview works fine, but in windows that are small enough to use the alternative layout the preview cannot be toggled.

This appears to happen only if the alternative layout is toggled as hidden explicitly, but not if this is inherited from the regular layout:

works: fzf --bind 'ctrl-p:toggle-preview' --preview 'stat {}' --preview-window='right,50%,<100(down,50%)'
works: fzf --bind 'ctrl-p:toggle-preview' --preview 'stat {}' --preview-window='right,50%,hidden,<100(down,50%)'
doesn't work: fzf --bind 'ctrl-p:toggle-preview' --preview 'stat {}' --preview-window='right,50%,<100(down,50%,hidden)'
doesn't work: fzf --bind 'ctrl-p:toggle-preview' --preview 'stat {}' --preview-window='right,50%,hidden,<100(down,50%,hidden)'

@junegunn junegunn added the bug label Jan 6, 2023
junegunn added a commit that referenced this issue Jan 7, 2023
  # Start fzf in a small screen so that the preview window is hidden
  fzf --bind 'ctrl-p:toggle-preview' --preview 'stat {}' --preview-window='right,50%,<100(down,50%,hidden)'

  # Enlarge the screen until the preview window appears. It should not be empty.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants