diff --git a/jj-fzf b/jj-fzf index 726836d..ee89753 100755 --- a/jj-fzf +++ b/jj-fzf @@ -63,6 +63,10 @@ case "${1:-}" in [[ " ${2:-} " =~ $OPRPAT ]] && { jj --no-pager --ignore-working-copy --color=always op show -p "${BASH_REMATCH[1]}" } ; exit ;; + preview_opdiff) + [[ " ${2:-} " =~ $OPRPAT ]] && { + jj --no-pager --ignore-working-copy --color=always op diff -f "${BASH_REMATCH[1]}" -t @ + } ; exit ;; esac # == Check Deps == @@ -941,9 +945,10 @@ op-log() temp_dir echo > $TEMPD/oplog.env H=$'\n' - H="$H"$'Ctrl-S: Preview "@" at a specific operation via `jj show @`\n' + H="$H"$'Ctrl-D: Preview the differences of an operation via `jj op diff -f -t @`\n' H="$H"$'Ctrl-L: Preview history at a specific operation via `jj log -r ..`\n' - H="$H"$'Ctrl-P: Preview patch at a specific operation via `jj op show -p `\n' + H="$H"$'Ctrl-P: Preview changes in an operation with patch via `jj op show -p `\n' + H="$H"$'Ctrl-S: Preview "@" at a specific operation via `jj show @`\n' H="$H"$'\n' H="$H"$'Alt-R: Restore repository to the selected operation via `jj op restore`\n' H="$H"$'Alt-W: Restore working copy of the selected operation into a new commit before @\n' @@ -956,9 +961,10 @@ op-log() --border-label '-[ OP-LOG ]-' --color=border:bright-yellow,label:bright-yellow \ --prompt "Operation > " \ --header "$H" --header-first \ - --bind "ctrl-s:execute-silent( gsed 's/^VIEW=.*/VIEW=preview_opshow/' -i $TEMPD/oplog.env )+refresh-preview" \ + --bind "ctrl-d:execute-silent( gsed 's/^VIEW=.*/VIEW=preview_opdiff/' -i $TEMPD/oplog.env )+refresh-preview" \ --bind "ctrl-l:execute-silent( gsed 's/^VIEW=.*/VIEW=preview_oplog/' -i $TEMPD/oplog.env )+refresh-preview" \ --bind "ctrl-p:execute-silent( gsed 's/^VIEW=.*/VIEW=preview_oppatch/' -i $TEMPD/oplog.env )+refresh-preview" \ + --bind "ctrl-s:execute-silent( gsed 's/^VIEW=.*/VIEW=preview_opshow/' -i $TEMPD/oplog.env )+refresh-preview" \ --bind "alt-r:execute( $SELF op-restore {} )+abort" \ --bind "alt-w:execute( $SELF restore-commit {} )+abort" \ --bind "alt-y:execute( $SELF undo-op {} )+$RELOAD" \