diff --git a/jj-fzf b/jj-fzf index e2b01d0..726836d 100755 --- a/jj-fzf +++ b/jj-fzf @@ -53,14 +53,14 @@ case "${1:-}" in jj --no-pager --ignore-working-copy --at-op "${BASH_REMATCH[1]}" --color=always op log --no-graph -n 1 -T builtin_op_log_comfortable jj --no-pager --ignore-working-copy --at-op "${BASH_REMATCH[1]}" --color=always log -r .. # -T builtin_log_oneline } ; exit ;; - preview_opdiff) + preview_opshow) [[ " ${2:-} " =~ $OPRPAT ]] && { jj --no-pager --ignore-working-copy --at-op "${BASH_REMATCH[1]}" --color=always op log --no-graph -n 1 -T builtin_op_log_comfortable jj --no-pager --ignore-working-copy --at-op "${BASH_REMATCH[1]}" --color=always log --no-graph -s -r "@" jj --no-pager --ignore-working-copy --at-op "${BASH_REMATCH[1]}" --color=always show -T ' "\n" ' -r "@" } ; exit ;; - preview_opshow) - [[ " ${2:-} " =~ ^[^a-z0-9]*([0-9a-f]{9,})\ ]] && { + preview_oppatch) + [[ " ${2:-} " =~ $OPRPAT ]] && { jj --no-pager --ignore-working-copy --color=always op show -p "${BASH_REMATCH[1]}" } ; exit ;; esac @@ -941,24 +941,24 @@ op-log() temp_dir echo > $TEMPD/oplog.env H=$'\n' - H="$H"$'Ctrl-D: Preview diff of "@" at a specific operation\n' - H="$H"$'Ctrl-L: Preview history at a specific operation\n' - H="$H"$'Ctrl-P: Preview patch at a specific operation via `jj op show -p`\n' + H="$H"$'Ctrl-S: Preview "@" at a specific operation via `jj show @`\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"$'\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' H="$H"$'Alt-Y: Undo/redo the selected operation entry\n' H="$H"$'Alt-Z: Undo the next operation\n' - echo 'VIEW=preview_opshow' >> $TEMPD/oplog.env + echo 'VIEW=preview_oppatch' >> $TEMPD/oplog.env export FZF_DEFAULT_COMMAND="$SELF op_log_oneline" RELOAD='reload(eval "$FZF_DEFAULT_COMMAND")' "${FZFPOPUP[@]}" \ --border-label '-[ OP-LOG ]-' --color=border:bright-yellow,label:bright-yellow \ --prompt "Operation > " \ --header "$H" --header-first \ - --bind "ctrl-d:execute-silent( gsed 's/^VIEW=.*/VIEW=preview_opdiff/' -i $TEMPD/oplog.env )+refresh-preview" \ + --bind "ctrl-s:execute-silent( gsed 's/^VIEW=.*/VIEW=preview_opshow/' -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_opshow/' -i $TEMPD/oplog.env )+refresh-preview" \ + --bind "ctrl-p:execute-silent( gsed 's/^VIEW=.*/VIEW=preview_oppatch/' -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" \