Fix preview when log message contains hash-like string (#13)

main
ptzz 2 years ago committed by GitHub
parent f31e8a07b5
commit 926a33da4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -177,9 +177,9 @@ _fzf_git_hashes() {
--prompt '🍡 Hashes> ' \
--header $'CTRL-O (open in browser) CTRL-D (diff) CTRL-S (toggle sort)\n\n' \
--bind "ctrl-o:execute-silent:bash $__fzf_git commit {}" \
--bind 'ctrl-d:execute:grep -o "[a-f0-9]\{7,\}" <<< {} | xargs git diff > /dev/tty' \
--bind 'ctrl-d:execute:grep -o "[a-f0-9]\{7,\}" <<< {} | head -n 1 | xargs git diff > /dev/tty' \
--color hl:underline,hl+:underline \
--preview 'grep -o "[a-f0-9]\{7,\}" <<< {} | xargs git show --color=always' "$@" |
--preview 'grep -o "[a-f0-9]\{7,\}" <<< {} | head -n 1 | xargs git show --color=always' "$@" |
grep -o "[a-f0-9]\{7,\}"
}

Loading…
Cancel
Save