Skip to content

change-preview-window should keep all other preview window configs unchanged #4791

@bigH

Description

@bigH

Checklist

  • I have read through the manual page (man fzf)
  • I have searched through the existing issues
  • For bug reports, I have checked if the bug is reproducible in the latest version of fzf

Output of fzf --version

0.72.0

OS

  • Linux
  • macOS
  • Windows
  • Etc.

Shell

  • bash
  • zsh
  • fish

Problem / Steps to reproduce

I would like any change-preview-window commands to keep any other preview configuration values unchanged. So, if I toggle wrapping on, resizing preview should retain the wrapping state.

printf 'item\n' |
fzf \
  --preview 'printf "%*s\n" 300 | tr " " x' \
  --preview-window 'right,40%,nowrap' \
  --bind 'ctrl-w:toggle-preview-wrap' \
  --bind 'ctrl-r:change-preview-window:80%'

Steps:

  1. Run the command.
  2. Press Ctrl-W to enable preview wrapping.
  3. Press Ctrl-R to resize preview to 80%.
  4. Press Ctrl-W again to show wrapped text in new preview size.

Expected: preview stays wrapped.

Actual: preview snaps back to startup nowrap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions