From f81d174f1112f9f8cd4ca62290b4bcbe219a5d5b Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 24 Oct 2018 17:56:18 +0200 Subject: [PATCH] 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. --- src/rcfile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rcfile.c b/src/rcfile.c index 8076c484..b0c58684 100644 --- 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