Remove deferred execution in _forgit_stash_show

This commit is contained in:
sandroid 2023-12-09 02:07:37 +01:00
parent 3010712ea7
commit f17b7eefc0
No known key found for this signature in database
GPG key ID: 91418C9982B8B76E

View file

@ -84,6 +84,16 @@ _forgit_yank_sha() {
echo "$1" | _forgit_extract_sha | ${FORGIT_COPY_CMD:-pbcopy}
}
# extract the first stash name in the input
_forgit_extract_stash_name() {
cut -d: -f1 | tr -d '[:space:]'
}
# extract the first stash name and copy it to the clipboard
_forgit_yank_stash_name() {
echo "$1" | _forgit_extract_stash_name | ${FORGIT_COPY_CMD:-pbcopy}
}
# parse a space separated string into an array
# arrays parsed with this function are global
_forgit_parse_array() {
@ -382,7 +392,7 @@ _forgit_stash_show() {
opts="
$FORGIT_FZF_DEFAULT_OPTS
+s +m -0 --tiebreak=index --bind=\"enter:execute($FORGIT stash_show_preview {} | $_forgit_enter_pager)\"
--bind=\"ctrl-y:execute-silent(echo {} | cut -d: -f1 | tr -d '[:space:]' | ${FORGIT_COPY_CMD:-pbcopy})\"
--bind=\"ctrl-y:execute-silent($FORGIT yank_stash_name {})\"
--preview=\"$FORGIT stash_show_preview {}\"
$FORGIT_STASH_FZF_OPTS
"
@ -940,6 +950,7 @@ private_commands=(
"stash_push_preview"
"stash_show_preview"
"yank_sha"
"yank_stash_name"
"log_preview"
"log_enter"
"exec_diff"