From ed4dac6f82a9105b38fffec60cd8737131c3fa4f Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Fri, 1 Nov 2024 01:16:10 +0100 Subject: [PATCH] glog: Make changing previews persistent Switch to using the `change-preview()` action that was introduced in 0.29.0 (which was actually not yet released for a year when this feature was first written). The old `preview()` is a one-off action while `change-preview()` changes the `--preview` option. This had the downside that when changing to a different preview and moving to the next commit one would had to repeat the change. This was especially annoying when looking through the history of a file that was renamed. With the commit that renamed the file all previous commits broke in the `files_only` preview as the path didn't exist yet (A possible but probably pretty hard TODO to fix). TODO: glog: Fix files_only preview for renamed files or give prompt to change the paths --- .config/zsh/autoload/git/glog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/zsh/autoload/git/glog b/.config/zsh/autoload/git/glog index 5b826f6..f56c781 100755 --- a/.config/zsh/autoload/git/glog +++ b/.config/zsh/autoload/git/glog @@ -99,11 +99,11 @@ local -A binds=( # TODO: This assumes less to be used in core.pager "enter" "execute@$fzf_preview[patch] | $pager -+F@" # Preview stats - "ctrl-s" "preview($fzf_preview[stat])" + "ctrl-s" "change-preview($fzf_preview[stat])" # Preview patch - "ctrl-p" "preview($fzf_preview[patch])" + "ctrl-p" "change-preview($fzf_preview[patch])" # Files only - "ctrl-f" "preview($fzf_preview[files_only])" + "ctrl-f" "change-preview($fzf_preview[files_only])" ) # TODO: Make the --preview argument dependent of --stat flag (i.e.