Fixing the rebinding of toggles.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5134 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2015-03-08 15:42:52 +00:00
parent 03bcaf6067
commit 79ff393dc2
2 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,7 @@
2015-03-08 Benno Schulenberg <bensberg@justemail.net> 2015-03-08 Benno Schulenberg <bensberg@justemail.net>
* src/proto.h, src/nano.c: Fix compilation with --enable-tiny plus * src/proto.h, src/nano.c: Fix compilation with --enable-tiny plus
--enable-nanorc. --enable-nanorc.
* src/rcfile.c (parse_binding): Fix the rebinding of toggles.
2015-03-07 Benno Schulenberg <bensberg@justemail.net> 2015-03-07 Benno Schulenberg <bensberg@justemail.net>
* doc/man/nanorc.5, doc/texinfo/nano.texi: Add a note about the * 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 GNU nano 2.3.99pre2 - 2015.02.27
2015-02-25 Chris Allegretta <chrisa@asty.org> 2015-02-25 Chris Allegretta <chrisa@asty.org>
* src/rcfile.c (parse_binding): Add an exception for do_toggle() as * 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> 2015-02-21 Benno Schulenberg <bensberg@justemail.net>
* README: Fix the explanation of how to subscribe to a mailing list. * README: Fix the explanation of how to subscribe to a mailing list.

View File

@ -505,7 +505,7 @@ void parse_binding(char *ptr, bool dobind)
fprintf(stderr, "unbinding \"%s\" from menu %x\n", keycopy, menu); fprintf(stderr, "unbinding \"%s\" from menu %x\n", keycopy, menu);
#endif #endif
if (dobind && newsc->scfunc != do_toggle_void) { if (dobind) {
subnfunc *f; subnfunc *f;
int mask = 0; int mask = 0;
@ -514,6 +514,10 @@ void parse_binding(char *ptr, bool dobind)
if (f->scfunc == newsc->scfunc) if (f->scfunc == newsc->scfunc)
mask = mask | f->menus; 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. */ /* Now limit the given menu to those where the function exists. */
if (is_universal(newsc->scfunc)) if (is_universal(newsc->scfunc))
menu = menu & MMOST; menu = menu & MMOST;