summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorSlaven Rezić <srezic@cpan.org>2020-04-24 15:56:55 +0200
committerGitHub <noreply@github.com>2020-04-24 22:56:55 +0900
commite6d33f77da8cc36786c814f499f6cb3405e8c4c1 (patch)
tree1cb9472d8dea1735894f93e5d622b6a461fb05a4 /shell
parenta6d3e3687ba2ee26266400db6c77a07bc4ff8fca (diff)
[zsh] Make CTRL-R work with older Perls (#2003)
s///r is only available since perl 5.14. The Perl oneliner was changed to work with older Perls, possibly even with 5.000. Fix #2001
Diffstat (limited to 'shell')
-rwxr-xr-x[-rw-r--r--]shell/key-bindings.zsh2
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh
index 19608926..74ce9b71 100644..100755
--- a/shell/key-bindings.zsh
+++ b/shell/key-bindings.zsh
@@ -100,7 +100,7 @@ bindkey '\ec' fzf-cd-widget
fzf-history-widget() {
local selected num
setopt localoptions noglobsubst noposixbuiltins pipefail no_aliases 2> /dev/null
- selected=( $(fc -rl 1 | perl -ne 'print if !$seen{($_ =~ s/^\s*[0-9]+\s+//r)}++' |
+ selected=( $(fc -rl 1 | perl -ne 'print if !$seen{(/^\s*[0-9]+\s+(.*)/, $1)}++' |
FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} $FZF_DEFAULT_OPTS -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS --query=${(qqq)LBUFFER} +m" $(__fzfcmd)) )
local ret=$?
if [ -n "$selected" ]; then