Skip to content

Commit

Permalink
fix: fix edit file key binding (alt-e) in diff and add (#415)
Browse files Browse the repository at this point in the history
The key binding for editing a file in diff and add was not working
properly on recent versions of fzf. As its documentation suggests, we
should replace `execute-silent` with `execute` since we need to switch
to a new screen and handle both input and output.

> fzf switches to the alternate screen when executing a command.
> However, if the command is expected to complete quickly, and you are
> not interested in its output, you might want to use execute-silent
> instead, which silently executes the command without the switching.
  • Loading branch information
wfxr authored Dec 22, 2024
1 parent 755b3dd commit df51911
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/git-forgit
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ _forgit_diff() {
$FORGIT_FZF_DEFAULT_OPTS
+m -0 --bind=\"enter:execute($FORGIT diff_enter {} $escaped_commits | $FORGIT pager enter)\"
--preview=\"$FORGIT diff_view {} '$_forgit_preview_context' $escaped_commits\"
--bind=\"alt-e:execute-silent($FORGIT edit_diffed_file {})+refresh-preview\"
--bind=\"alt-e:execute($FORGIT edit_diffed_file {})+refresh-preview\"
$FORGIT_DIFF_FZF_OPTS
--prompt=\"${commits[*]} > \"
"
Expand Down Expand Up @@ -382,7 +382,7 @@ _forgit_add() {
$FORGIT_FZF_DEFAULT_OPTS
-0 -m --nth 2..,..
--preview=\"$FORGIT add_preview {}\"
--bind=\"alt-e:execute-silent($FORGIT edit_add_file {})+refresh-preview\"
--bind=\"alt-e:execute($FORGIT edit_add_file {})+refresh-preview\"
$FORGIT_ADD_FZF_OPTS
"
files=()
Expand Down

0 comments on commit df51911

Please sign in to comment.