summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-11-06 08:38:36 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-11-06 08:38:36 +0900
commitc84e6815815092de61fbd1b76164810c6627a4f5 (patch)
tree126455ff5d751246345a753ed392bc4803e36ac1 /shell
parent2c4f71d85b2ac8dab1e270f0648387b9e099c2ec (diff)
parentc3cf3427b113514279b47349a993db51353a364a (diff)
Merge pull request #403 from JackDanger/not-relying-on-exit-status-for-ctrl-r
Not relying on exit status for CTRL-R Patch submitted by @robinro and @JackDanger Close #403 #242 #241 #203
Diffstat (limited to 'shell')
-rw-r--r--shell/key-bindings.zsh3
1 files changed, 2 insertions, 1 deletions
diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh
index c429d918..eccc8266 100644
--- a/shell/key-bindings.zsh
+++ b/shell/key-bindings.zsh
@@ -37,7 +37,8 @@ bindkey '\ec' fzf-cd-widget
# CTRL-R - Paste the selected command from history into the command line
fzf-history-widget() {
local selected num
- if selected=( $(fc -l 1 | $(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r -q "$LBUFFER") ); then
+ selected=( $(fc -l 1 | $(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r -q "$LBUFFER") )
+ if [ -n "$selected" ]; then
num=$selected[1]
if [ -n "$num" ]; then
zle vi-fetch-history -n $num