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

Dynamically changing preview label position #3862

Open
4 of 10 tasks
jdujava opened this issue Jun 14, 2024 · 4 comments
Open
4 of 10 tasks

Dynamically changing preview label position #3862

jdujava opened this issue Jun 14, 2024 · 4 comments

Comments

@jdujava
Copy link

jdujava commented Jun 14, 2024

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.53.0 (c4a9ccd)

OS

  • Linux
  • macOS
  • Windows
  • Etc.

Shell

  • bash
  • zsh
  • fish

Problem / Steps to reproduce

Is there a way to dynamically change the preview label position? Reading through the documentation I was unable to find something along the lines of change-preview-label-pos action.

Since change-preview-label already is implemented, wouldn't it be more convenient to merge options preview-label and preview-label-pos into one, of the signature along the lines

--preview-label=[N:top|bottom:]LABEL
@junegunn
Copy link
Owner

No. But why would you do that? I can't think of a case where moving the label would benefit the user. Wouldn't it just be confusing?

@jdujava
Copy link
Author

jdujava commented Jun 14, 2024

I am dynamically changing the preview, and I wanted to somehow differentiate between two possible modes. I was considering multiple options:

  • changing the label (isn't that noticable)
  • changing the preview border style
  • changing the preview background (together with different border style the alternate preview could "pop-up" more)

I also considered that the alternate preview could have different position of label (top vs bottom, left vs center vs right). I wanted to try it out, and thus this feature request.

@junegunn
Copy link
Owner

junegunn commented Jun 14, 2024

So it's not something you absolutely need.

Please note that preview/border labels can show ANSI colors, it might help in your case.

fzf --preview 'cat {}' --preview-label $' \x1b[33myellow ' --bind $'space:change-preview-label: \x1b[34mblue '

@jdujava
Copy link
Author

jdujava commented Jun 14, 2024

So it's not something you absolutely need.

Certainly not. Nevertheless, it could be nice to have the option (if someone finds the free time to implement it :).

Please note that preview/border labels can show ANSI colors, it might help in your case.

Thanks for the suggestion!

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

2 participants