summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2016-06-08 01:30:26 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2016-06-08 01:30:26 +0900
commit95b34de339822d6e81898c7e52f94a7165be39bc (patch)
tree8e6ba2b05b57375cbbee4325298b499f7224e800 /shell
parent6a431cbf49799327d763681758943be9e313b034 (diff)
[bash/zsh] Fix $FZF_CTRL_R_OPTS with option values with spaces
Diffstat (limited to 'shell')
-rw-r--r--shell/key-bindings.bash2
-rw-r--r--shell/key-bindings.zsh2
2 files changed, 2 insertions, 2 deletions
diff --git a/shell/key-bindings.bash b/shell/key-bindings.bash
index 41e707ea..b87decaa 100644
--- a/shell/key-bindings.bash
+++ b/shell/key-bindings.bash
@@ -51,7 +51,7 @@ __fzf_history__() (
shopt -u nocaseglob nocasematch
line=$(
HISTTIMEFORMAT= history |
- $(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r $FZF_CTRL_R_OPTS |
+ eval "$(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r $FZF_CTRL_R_OPTS" |
\grep '^ *[0-9]') &&
if [[ $- =~ H ]]; then
sed 's/^ *\([0-9]*\)\** .*/!\1/' <<< "$line"
diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh
index a173b12f..f77e7ec3 100644
--- a/shell/key-bindings.zsh
+++ b/shell/key-bindings.zsh
@@ -39,7 +39,7 @@ bindkey '\ec' fzf-cd-widget
fzf-history-widget() {
local selected num
setopt localoptions noglobsubst
- selected=( $(fc -l 1 | $(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r ${=FZF_CTRL_R_OPTS} -q "${LBUFFER//$/\\$}") )
+ selected=( $(fc -l 1 | eval "$(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r $FZF_CTRL_R_OPTS -q ${(q)LBUFFER}") )
if [ -n "$selected" ]; then
num=$selected[1]
if [ -n "$num" ]; then