junegunn / fzf

:cherry_blossom: A command-line fuzzy finder
https://junegunn.github.io/fzf/
MIT License
61.95k stars 2.34k forks source link

left-align preview window to the right of the finder #3813

Open ddickstein opened 1 month ago

ddickstein commented 1 month ago

Checklist

Output of fzf --version

0.23.0

OS

Shell

Problem / Steps to reproduce

Currently if I left-align the preview window, it appears first (on the left), followed by the finder. If I right-align it, it appears all the way on the right, which may be far away from the finder in the case of a large number of columns (and a fixed-width preview window). I'd like to have a way to have it appear on the right of the finder, but as close as possible to it (i.e. leftmost viable position without clobbering text from finder options). I can think of a couple possibilities here:

  1. If running with --sync, examine the string lengths of all the options and place the preview window just after the longest.
  2. Simpler, let users say the preview window should be left-aligned, but offset by N columns, which gives space for the finder window. Let users figure out an appropriate value for N based on the expected input lengths.
LangLangBart commented 1 month ago

I'd like to have a way to have it appear on the right of the finder, but as close as possible to it

Possible duplicate of #3570