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.
This commit is contained in:
Benno Schulenberg
2018-11-14 17:41:32 +01:00
parent 4fc728b405
commit f81d174f11
+3 -1
View File
@@ -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