summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorLangLangBart <92653266+LangLangBart@users.noreply.github.com>2024-11-14 02:38:05 +0100
committerGitHub <noreply@github.com>2024-11-14 10:38:05 +0900
commit71e4d5cc5129b912af33b239983545969970ccf4 (patch)
treea0d17b0ea682b5fa0bc5af81a69e1b0767d1bd21 /shell
parent215ab48222ac5fa8855c1e5bbf56742276b57324 (diff)
downloadfzf-71e4d5cc5129b912af33b239983545969970ccf4.tar.gz
revert(zsh): remove 'fc -RI' call in the history widget (#4093)
Diffstat (limited to 'shell')
-rw-r--r--shell/key-bindings.zsh14
1 files changed, 4 insertions, 10 deletions
diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh
index 36881185..3c17401c 100644
--- a/shell/key-bindings.zsh
+++ b/shell/key-bindings.zsh
@@ -112,16 +112,10 @@ fzf-history-widget() {
# as the associative 'history' array, which maps event numbers to full history
# lines, are set. Also, make sure Perl is installed for multi-line output.
if zmodload -F zsh/parameter p:{commands,history} 2>/dev/null && (( ${+commands[perl]} )); then
- # Import commands from other shells if SHARE_HISTORY is enabled, as the
- # 'history' array only updates after executing a non-empty command.
- selected="$(
- if [[ -o sharehistory ]]; then
- fc -RI
- fi
- printf '%s\t%s\000' "${(kv)history[@]}" |
- perl -0 -ne 'if (!$seen{(/^\s*[0-9]+\**\t(.*)/s, $1)}++) { s/\n/\n\t/g; print; }' |
- FZF_DEFAULT_OPTS=$(__fzf_defaults "" "-n2..,.. --scheme=history --bind=ctrl-r:toggle-sort --wrap-sign '\t↳ ' --highlight-line ${FZF_CTRL_R_OPTS-} --query=${(qqq)LBUFFER} +m --read0") \
- FZF_DEFAULT_OPTS_FILE='' $(__fzfcmd))"
+ selected="$(printf '%s\t%s\000' "${(kv)history[@]}" |
+ perl -0 -ne 'if (!$seen{(/^\s*[0-9]+\**\t(.*)/s, $1)}++) { s/\n/\n\t/g; print; }' |
+ FZF_DEFAULT_OPTS=$(__fzf_defaults "" "-n2..,.. --scheme=history --bind=ctrl-r:toggle-sort --wrap-sign '\t↳ ' --highlight-line ${FZF_CTRL_R_OPTS-} --query=${(qqq)LBUFFER} +m --read0") \
+ FZF_DEFAULT_OPTS_FILE='' $(__fzfcmd))"
else
selected="$(fc -rl 1 | awk '{ cmd=$0; sub(/^[ \t]*[0-9]+\**[ \t]+/, "", cmd); if (!seen[cmd]++) print $0 }' |
FZF_DEFAULT_OPTS=$(__fzf_defaults "" "-n2..,.. --scheme=history --bind=ctrl-r:toggle-sort --wrap-sign '\t↳ ' --highlight-line ${FZF_CTRL_R_OPTS-} --query=${(qqq)LBUFFER} +m") \