diff --git a/ChangeLog b/ChangeLog index f4dd3d23d5d89760f76d3c7947701b06e9f488a9..29b3267d5b8a5d69fbc4a1363205b73e24c66b37 100644 --- 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 index 28313a7c641b3da4d01360420d51b057685fdcd0..502e26a304560bec1892b1266cf25f2b10e393b9 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;