More alternative notations for execute action

execute(...)
    execute[...]
    execute~...~
    execute!...!
    execute@...@
    execute#...#
    execute$...$
    execute%...%
    execute^...^
    execute&...&
    execute*...*
    execute:...:
    execute;...;
    execute/.../
    execute|...|
This commit is contained in:
Junegunn Choi
2015-06-14 23:36:49 +09:00
parent 6c99cc1700
commit 022435a90a
2 changed files with 17 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
package fzf
import (
"fmt"
"testing"
"github.com/junegunn/fzf/src/curses"
@@ -167,6 +168,12 @@ func TestBind(t *testing.T) {
checkString("echo (,),[,],/,:,;,%,{}", execmap[curses.AltA])
checkString("echo (,),[,],/,:,@,%,{}", execmap[curses.AltB])
for idx, char := range []rune{'~', '!', '@', '#', '$', '%', '^', '&', '*', '|', ':', ';', '/'} {
keymap, execmap, toggleSort =
parseKeymap(keymap, execmap, false, fmt.Sprintf("%d:execute%cfoobar%c", idx%10, char, char))
checkString("foobar", execmap[curses.AltZ+int([]rune(fmt.Sprintf("%d", idx%10))[0])])
}
keymap, execmap, toggleSort = parseKeymap(keymap, execmap, false, "f1:abort")
if toggleSort {
t.Errorf("toggleSort set")