From c3a4e4cd237f9e31fc0b971b8b6d8a51efc9b59a Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 12 Jun 2014 23:43:09 +0900 Subject: [PATCH] Implement CTRL-D --- README.md | 1 + fzf | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c05c579e..75597f65 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,7 @@ The following readline key bindings should also work as expected. - CTRL-A / CTRL-E - CTRL-B / CTRL-F +- CTRL-H / CTRL-D - CTRL-W / CTRL-U / CTRL-Y - ALT-B / ALT-F diff --git a/fzf b/fzf index 1ea6a8ee..bd08f241 100755 --- a/fzf +++ b/fzf @@ -7,7 +7,7 @@ # / __/ / /_/ __/ # /_/ /___/_/ Fuzzy finder for your shell # -# Version: 0.8.5 (Jun 7, 2014) +# Version: 0.8.5 (Jun 12, 2014) # # Author: Junegunn Choi # URL: https://github.com/junegunn/fzf @@ -881,7 +881,13 @@ class FZF } actions = { :esc => proc { exit 1 }, - ctrl(:d) => proc { exit 1 if input.empty? }, + ctrl(:d) => proc { + if input.empty? + exit 1 + elsif cursor < input.length + input = input[0...cursor] + input[(cursor + 1)..-1] + end + }, ctrl(:m) => proc { got = pick exit 0