summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLangLangBart <92653266+LangLangBart@users.noreply.github.com>2024-06-20 10:51:52 +0200
committerGitHub <noreply@github.com>2024-06-20 17:51:52 +0900
commitdb01e7dab65423cd1d14e15f5b15dfaabe760283 (patch)
tree72fd5fa9e67d14359c4db203eee1e284bc823803
parent2326c74eb241d4667545eae3deaded4a06710521 (diff)
fix(zsh): add (s) modifier to perl command (#3882)
-rw-r--r--shell/key-bindings.zsh4
1 files changed, 2 insertions, 2 deletions
diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh
index f488a46b..b6f0b376 100644
--- a/shell/key-bindings.zsh
+++ b/shell/key-bindings.zsh
@@ -111,8 +111,8 @@ fzf-history-widget() {
# Ensure the associative history array, which maps event numbers to the full
# history lines, is loaded, and that Perl is installed for multi-line output.
if zmodload -F zsh/parameter p:history 2>/dev/null && (( ${#commands[perl]} )); then
- selected="$(printf '%1$s\t%2$s\000' "${(vk)history[@]}" |
- perl -0 -ne 'if (!$seen{(/^\s*[0-9]+\**\s+(.*)/, $1)}++) { s/\n/\n\t/gm; print; }' |
+ 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 --highlight-line ${FZF_CTRL_R_OPTS-} --query=${(qqq)LBUFFER} +m --read0") \
FZF_DEFAULT_OPTS_FILE='' $(__fzfcmd))"
else