Closed carlfriedrich closed 2 years ago
Since I don't see any drawbacks in making the proposed change, I just filed a PR #186 to fix this. Would love to see this merged.
Sorry, I accidentally closed this when I merged the change into my own fork. Reopen it to merge it here as well. @wfxr Let me know if you accept the change.
@carlfriedrich Nice improvement, thanks for your contribution!
Check list
Environment info
Problem / Steps to reproduce
I would like to customize the preview command that it used in
glo
, so I thought I could easily add it toFORGIT_LOG_FZF_OPTS
like described in the README. This does not work, however, because the--preview
option is not included inFZF_DEFAULT_OPTS
but a hard-coded argument tofzf
:https://github.com/wfxr/forgit/blob/e0d3552d4597f42c5c965daa5abd79845990f63a/forgit.plugin.zsh#L33
Is there a specific reason for this, or would it be possible to move the
--preview="$cmd"
argument into theopts
between line 27 and 28?https://github.com/wfxr/forgit/blob/e0d3552d4597f42c5c965daa5abd79845990f63a/forgit.plugin.zsh#L23-L33
That way I would be able to override the preview command in
FORGIT_LOG_FZF_OPTS
.This also affects most other commands with their corresponding variables:
FORGIT_DIFF_FZF_OPTS
FORGIT_ADD_FZF_OPTS
FORGIT_RESET_HEAD_FZF_OPTS
FORGIT_STASH_FZF_OPTS
FORGIT_REBASE_FZF_OPTS
FORGIT_FIXUP_FZF_OPTS
FORGIT_CHECKOUT_FILE_FZF_OPTS
FORGIT_CHECKOUT_BRANCH_FZF_OPTS
FORGIT_CHECKOUT_TAG_FZF_OPTS
FORGIT_COMMIT_FZF_OPTS
FORGIT_IGNORE_FZF_OPTS
(BTW why doesn't
forgit::cherry::pick
have a corresponding variable?)If nothing speaks against that, I could provide a pull request for it.