wfxr / forgit

:zzz: A utility tool powered by fzf for using git interactively.
MIT License
4.32k stars 136 forks source link

Question: direction of tab #298

Closed albertfgu closed 1 year ago

albertfgu commented 1 year ago

Check list

Environment info

Problem / Steps to reproduce

I have a question. The documentation says that <Tab> is "Toggle mark and move up" and <S-Tab> is "Toggle mark and move down". However in all my installations of forgit, the behavior has always been opposite; <Tab> always moves down. So unless I'm misunderstanding, the actual behavior doesn't match the documentation. Which one is intended? Also, is there a way to reverse the behavior if desired?

carlfriedrich commented 1 year ago

The documented way is the default configuration. If you happen to have set --reverse in either FORGIT_FZF_DEFAULT_OPTS or FZF_DEFAULT_OPTS then it will be the other way round, though. Might that be the case in your environment?

albertfgu commented 1 year ago

Thanks for getting back so quickly! This doesn't seem to be the case:

❯ echo $FORGIT_FZF_DEFAULT_OPTS

❯ echo $FZF_DEFAULT_OPTS

❯ env | grep FZF
FZF_DEFAULT_COMMAND=rg --files --no-ignore --hidden --follow --glob "!.git/*"
FZF_CTRL_R_OPTS=--preview 'echo {}' --preview-window down:3:hidden:wrap --bind '?:toggle-preview'
carlfriedrich commented 1 year ago

@albertfgu Ah hm, that's strange. So how does a simple fzf -m call behave then on your system? Does tab move up or down there?

albertfgu commented 1 year ago

It moves down

albertfgu commented 1 year ago

I did a quick google and found this issue which seems to imply that the default behavior of FZF is that Tab always moves down: https://github.com/junegunn/fzf/issues/845

carlfriedrich commented 1 year ago

@albertfgu Ah, thanks for clarifying! That was actually new to me.

So then our documentation definitely seems wrong here.

@wfxr @cjappl Are we missing anything from your perspective? Otherwise I would prepare a PR to update the docs.

albertfgu commented 1 year ago

But I'm confused about what the default is for other people. The fact that you thought the documentation is correct suggests that you tried it and Tab does move up by default in your installation? I also did some googling and other blog posts suggest that Tab moves up in multi-select for fzf. So I'm very confused, hence the issue I opened directly in fzf above

albertfgu commented 1 year ago

junegunn has replied saying that Tab goes down! https://github.com/junegunn/fzf/issues/3256 Maybe the documentation for forgit could be updated?

cjappl commented 1 year ago

I have no objection to a documentation update :)

Tab goes down for me as well. Feel free to open a pr @albertfgu