commit f81d174f1112f9f8cd4ca62290b4bcbe219a5d5b
parent 4fc728b40538df59911cd87bea5f8194c6d7ebbf
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 24 Oct 2018 17:56:18 +0200
rcfile: when a keystroke is rebound, don't bother unbinding it
The new binding will be put at the head of the list and thus will
be the one that is found -- the old binding will never be seen, so
rubbing it out is just a waste of time.
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/rcfile.c b/src/rcfile.c
@@ -468,11 +468,13 @@ void parse_binding(char *ptr, bool dobind)
}
}
- /* Now find and delete any existing same shortcut in the menu(s). */
+ if (!dobind) {
+ /* Find and wipe the given shortcut from the given menu. */
for (s = sclist; s != NULL; s = s->next) {
if ((s->menus & menu) && !strcmp(s->keystr, keycopy))
s->menus &= ~menu;
}
+ }
if (dobind) {
#ifndef NANO_TINY