From fa5b58968e67a7f046d67554174a1923cfb30ea9 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 15 Jun 2015 23:00:38 +0900 Subject: Add alternative execute notation that does not require closing char This can be used to avoid parse errors that can happen when the command contains the closing character. Since the command does not finish at a certain character, the key binding should be the last one in the group. Suggested by @tiziano88. (#265) e.g. fzf --bind "ctrl-m:execute=COMMAND..." --bind ctrl-j:accept --- src/options_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/options_test.go') diff --git a/src/options_test.go b/src/options_test.go index 630bde3b..162b8e48 100644 --- a/src/options_test.go +++ b/src/options_test.go @@ -163,7 +163,8 @@ func TestBind(t *testing.T) { parseKeymap(keymap, execmap, false, "ctrl-a:kill-line,ctrl-b:toggle-sort,c:page-up,alt-z:page-down,"+ "f1:execute(ls {}),f2:execute/echo {}, {}, {}/,f3:execute[echo '({})'],f4:execute:less {}:,"+ - "alt-a:execute@echo (,),[,],/,:,;,%,{}@,alt-b:execute;echo (,),[,],/,:,@,%,{};") + "alt-a:execute@echo (,),[,],/,:,;,%,{}@,alt-b:execute;echo (,),[,],/,:,@,%,{};"+ + ",X:execute=foobar,Y:execute(baz)") if !toggleSort { t.Errorf("toggleSort not set") } @@ -181,6 +182,7 @@ func TestBind(t *testing.T) { checkString("less {}", execmap[curses.F4]) checkString("echo (,),[,],/,:,;,%,{}", execmap[curses.AltA]) checkString("echo (,),[,],/,:,@,%,{}", execmap[curses.AltB]) + checkString("foobar,Y:execute(baz)", execmap[curses.AltZ+'X']) for idx, char := range []rune{'~', '!', '@', '#', '$', '%', '^', '&', '*', '|', ':', ';', '/'} { keymap, execmap, toggleSort = -- cgit v1.2.3