mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-09 15:34:11 +01:00
Match Vim's behaviour with <Nop> in the RHS of a mapping.
<Nop> is not remapped if it is the complete RHS of a mapping otherwise it behaves like any other key.
This commit is contained in:
@@ -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 (/^<Nop>$/i.test(rhs))
|
||||
noremap = true;
|
||||
|
||||
for (let [,m] in Iterator(mode))
|
||||
{
|
||||
mappings.addUserMap([m], [lhs],
|
||||
|
||||
Reference in New Issue
Block a user