From f1cd0e2daf4b0ba8fbe94b334a321c9c287414ad Mon Sep 17 00:00:00 2001
From: Junegunn Choi <junegunn.c@gmail.com>
Date: Mon, 9 Nov 2015 12:06:10 +0900
Subject: [PATCH] [zsh] Fix #404 - Escape $ in $LBUFFER

---
 shell/key-bindings.zsh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shell/key-bindings.zsh b/shell/key-bindings.zsh
index 29721fc9..5817ee80 100644
--- a/shell/key-bindings.zsh
+++ b/shell/key-bindings.zsh
@@ -38,7 +38,7 @@ bindkey '\ec' fzf-cd-widget
 # CTRL-R - Paste the selected command from history into the command line
 fzf-history-widget() {
   local selected num
-  selected=( $(fc -l 1 | $(__fzfcmd) +s --tac +m -n2..,.. --tiebreak=index --toggle-sort=ctrl-r -q "$LBUFFER") )
+  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
-- 
GitLab