summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Carl <danielcarl@gmx.de>2015-02-14 21:41:33 +0100
committerDaniel Carl <danielcarl@gmx.de>2015-02-14 21:56:10 +0100
commit87ddae9ebd8b1ff5ad0b0d3a1d1d674e31dc96d6 (patch)
tree1faae4775fac06403fd0ddd45c4485dfc2ec32da /tests
parent191726dc57d587333a29914ac3dee508c01380d9 (diff)
Add <Space> as special map key name (#176).
Normally the literal space char ' ' can be used for mappings. In case this is part of the lhs it can be given escaped by '\'. But this does not work on the rhs, because there is no evaluation of escaping for space like in vim. On the other hand the rhs starts with the first none whitespace char after the lhs. So it wasn't possible to apply mapping to sequences that starts with one or more spaces. This patch adds the new special key name '<Space>' to be used in this cases.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-map.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test-map.c b/tests/test-map.c
index 2333d54..e0a66b5 100644
--- a/tests/test-map.c
+++ b/tests/test-map.c
@@ -56,6 +56,7 @@ static void test_handle_string_simple(void)
ASSERT_MAPPING("a", "[a]");
ASSERT_MAPPING("b", "[b]");
ASSERT_MAPPING("[c]", "c");
+ ASSERT_MAPPING("d", " [d]");
ASSERT_MAPPING("<Tab>", "[tab]");
ASSERT_MAPPING("<S-Tab>", "[shift-tab]");
ASSERT_MAPPING("<C-F>", "[ctrl-f]");
@@ -162,6 +163,7 @@ int main(int argc, char *argv[])
/* add some mappings to test */
map_insert("a", "[a]", 't', false); /* inlen < mappedlen */
map_insert("b", "[b]", 't', false);
+ map_insert("d", "<Space>[d]", 't', false);
map_insert("[c]", "c", 't', false); /* inlen > mappedlen */
map_insert("foobar", "[baz]", 't', false);
map_insert("<Tab>", "[tab]", 't', false);