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.
master
Benno Schulenberg 2018-10-24 17:56:18 +02:00
parent 4fc728b405
commit f81d174f11
1 changed files with 3 additions and 1 deletions

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