nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 79ff393dc24b2e8844e939a84bb5bf5de781343e
parent 03bcaf6067f02966d8448e8cc01bbfbe301ebf27
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Sun,  8 Mar 2015 15:42:52 +0000

Fixing the rebinding of toggles.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5134 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

Diffstat:
MChangeLog | 3++-
Msrc/rcfile.c | 6+++++-
2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,6 +1,7 @@ 2015-03-08 Benno Schulenberg <bensberg@justemail.net> * 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 <bensberg@justemail.net> * 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 <chrisa@asty.org> * 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 <bensberg@justemail.net> * README: Fix the explanation of how to subscribe to a mailing list. diff --git 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;