handle keys of push command while scanning

This commit is contained in:
Gokcehan committed 2016-10-15 21:46:31 +03:00
1 parent cecd3f9904
commit a3965ca1d9
7 files changed
+50 -6

No files matched your search

+30
View File
@@ -113,6 +113,36 @@ var gTests = []struct {
[]Expr{&MapExpr{"u", &ListExpr{[]Expr{&CallExpr{"usage", nil}}}}},
},
{
"map r push :rename<space>",
[]string{"map", "r", "push", ":rename<space>", "\n"},
[]Expr{&MapExpr{"r", &CallExpr{"push", []string{":rename<space>"}}}},
},
{
"map r push :rename<space>;",
[]string{"map", "r", "push", ":rename<space>;", "\n"},
[]Expr{&MapExpr{"r", &CallExpr{"push", []string{":rename<space>;"}}}},
},
{
"map r push :rename<space> # trailing comments area allowed after a space",
[]string{"map", "r", "push", ":rename<space>", "\n"},
[]Expr{&MapExpr{"r", &CallExpr{"push", []string{":rename<space>"}}}},
},
{
"map r :push :rename<space>",
[]string{"map", "r", ":", "push", ":rename<space>", "\n", "\n"},
[]Expr{&MapExpr{"r", &ListExpr{[]Expr{&CallExpr{"push", []string{":rename<space>"}}}}}},
},
{
"map r :push :rename<space> ; set hidden",
[]string{"map", "r", ":", "push", ":rename<space>", ";", "set", "hidden", "\n", "\n"},
[]Expr{&MapExpr{"r", &ListExpr{[]Expr{&CallExpr{"push", []string{":rename<space>"}}, &SetExpr{"hidden", ""}}}}},
},
{
"map u $du -h . | less",
[]string{"map", "u", "$", "du -h . | less", "\n"},