junegunn / fzf

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

Allow pointer to be disabled #3879

Closed jaminthorns closed 2 weeks ago

jaminthorns commented 2 weeks ago

Checklist

Output of fzf --version

0.53.0 (brew)

OS

Shell

Problem / Steps to reproduce

Since the current line is highlighted by default (and the color can be changed with --color=bg+:_), and with the addition of the --highlight-line option in 0.52.0, the pointer doesn't seem that necessary to me. Setting --pointer to an empty string or a space is explicitly not supported and returns the following error message:

pointer cannot be empty

I can set --pointer to be an "exotic" space like a punctuation space, but that feels hacky and still leaves an unnecessary extra column on the left that wastes space.

It would be nice if the pointer could be completely disabled, either by supporting an empty string value for --pointer (like --pointer=) or through another option like --disable-pointer, which would completely remove the the pointer column. An extra check to ensure line highlighting isn't disabled (which would make discerning the current line impossible) might make sense as well.

EDIT: Setting the pointer to a space is supported, I just had an issue with setting the FZF_DEFAULT_OPTS environment variable (see comment below).

junegunn commented 2 weeks ago

Setting --pointer to an empty string or a space is explicitly not supported

Is it? Ordinary space works for me.

fzf --pointer ' ' --color gutter:-1 --highlight-line

still leaves an unnecessary extra column on the left that wastes space.

I'm not sure about removing the extra column, as the overall layout is nicely aligned on the third column.

image

jaminthorns commented 2 weeks ago

Ah, so my issue was in how I was setting FZF_DEFAULT_OPTS, as:

set FZF_DEFAULT_OPTS ... --pointer=" " ...

becomes

... --pointer=  ...

which of course fzf sees as an empty string. My bad on that one, no issue there.

I suppose the alignment is nice, and it makes sense as the default, but I'd personally like to have that unused space back, as well as the column for the selection marker when --multi isn't set (I know that wasn't part of my original issue).

I have a pretty minimal default display (just a prompt, no info or separator), and for input like a multi-line git log display with a graph, alignment isn't really concern, but space is:

Screenshot 2024-06-19 at 10 46 06 AM

This is definitely less of an issue now that I know setting a blank pointer is straightforward, but the removal of the columns is something I'd still like to have. Feel free to close if you don't have a desire to implement, though. 🙂

junegunn commented 2 weeks ago

See c3cc378d8919da13dea3094e23d9bcfc12226ad8. Please test it and let me know if there's a problem.

jaminthorns commented 2 weeks ago

Tested and confirmed working. Thank you! 😁