Skip to content

Commit

Permalink
refactor: use accept-or-print-query for history commands
Browse files Browse the repository at this point in the history
  • Loading branch information
LangLangBart committed Sep 23, 2024
1 parent 8679da1 commit 0b0dcfd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gh-find-code
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ view_history_commands() {
--bind "ctrl-c:become:curl_custom 'abort'" \
--bind "ctrl-d:reload:remove_history {2..}; $history_command" \
--bind "${GHFC_TOGGLE_HISTORY_KEY}:abort" \
--bind 'enter:accept' \
--bind 'enter:accept-or-print-query' \
--bind 'esc:abort' \
--color "header:${header_color:--1}" \
--delimiter '\s+' \
Expand All @@ -910,7 +910,9 @@ view_history_commands() {
--prompt 'Select a History Entry > ' \
--scheme history
) && [[ -n $selection ]]; then
selection="$(command awk '{$1=""; sub(/^[ \t]+/, ""); print $0}' <<<"$selection")"
if [[ $selection =~ ^[1-9][0-9]*[[:blank:]]+ ]]; then
selection="$(command awk '{$1=""; sub(/^[ \t]+/, ""); print $0}' <<<"$selection")"
fi
curl_custom "change-query:$selection"
fi
: >"$store_hold_gh_query_loop"
Expand Down

0 comments on commit 0b0dcfd

Please sign in to comment.