From 79ff393dc24b2e8844e939a84bb5bf5de781343e Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 8 Mar 2015 15:42:52 +0000 Subject: [PATCH] Fixing the rebinding of toggles. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5134 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 3 ++- src/rcfile.c | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f4dd3d23..29b3267d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2015-03-08 Benno Schulenberg * src/proto.h, src/nano.c: Fix compilation with --enable-tiny plus --enable-nanorc. + * src/rcfile.c (parse_binding): Fix the rebinding of toggles. 2015-03-07 Benno Schulenberg * doc/man/nanorc.5, doc/texinfo/nano.texi: Add a note about the @@ -15,7 +16,7 @@ GNU nano 2.3.99pre2 - 2015.02.27 2015-02-25 Chris Allegretta * src/rcfile.c (parse_binding): Add an exception for do_toggle() as - rebinding toggles broke with r5022. + rebinding toggles broke with r5022. (Fixed in r5134.) 2015-02-21 Benno Schulenberg * README: Fix the explanation of how to subscribe to a mailing list. diff --git a/src/rcfile.c b/src/rcfile.c index 28313a7c..502e26a3 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -505,7 +505,7 @@ void parse_binding(char *ptr, bool dobind) fprintf(stderr, "unbinding \"%s\" from menu %x\n", keycopy, menu); #endif - if (dobind && newsc->scfunc != do_toggle_void) { + if (dobind) { subnfunc *f; int mask = 0; @@ -514,6 +514,10 @@ void parse_binding(char *ptr, bool dobind) if (f->scfunc == newsc->scfunc) mask = mask | f->menus; + /* Handle the special case of the toggles. */ + if (newsc->scfunc == do_toggle_void) + mask = MMAIN; + /* Now limit the given menu to those where the function exists. */ if (is_universal(newsc->scfunc)) menu = menu & MMOST;