From 18bf61c1e0663bcf2d684c3a76508d920824dfcb Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 11 Jul 2009 00:14:13 +1000 Subject: [PATCH] Match Vim's behaviour with in the RHS of a mapping. is not remapped if it is the complete RHS of a mapping otherwise it behaves like any other key. --- common/content/mappings.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/content/mappings.js b/common/content/mappings.js index 966200bb..d5e46f19 100644 --- a/common/content/mappings.js +++ b/common/content/mappings.js @@ -221,13 +221,16 @@ function Mappings() //{{{ return; } - // ?:\s+ <- don't remember; (...)? optional = rhs let [lhs, rhs] = args; if (!rhs) // list the mapping mappings.list(mode, expandLeader(lhs)); else { + // this matches Vim's behaviour + if (/^$/i.test(rhs)) + noremap = true; + for (let [,m] in Iterator(mode)) { mappings.addUserMap([m], [lhs],