From: Chris Allegretta Date: Wed, 5 Mar 2014 04:30:07 +0000 (+0000) Subject: 2014-03-04 Chris Allegretta X-Git-Tag: v2.3.3~288 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=f7c68cd1434a3e4878c872934bef9b4940fd8019;p=nano.git 2014-03-04 Chris Allegretta * global.c (first_sc_for) - Return raw keystrokes last, so they will not be displayed if there are F-key or Meta keys mapped for an item in the shortcut list. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4642 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 73b9b61f..4bb9ec1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-03-04 Chris Allegretta + * global.c (first_sc_for) - Return raw keystrokes last, so + they will not be displayed if there are F-key or Meta keys + mapped for an item in the shortcut list. + 2014-03-04 Benno Schulenberg * doc/syntax/nanorc.nanorc - Add keyword 'quiet', sort 'locking', and concatenate the two separate strings into one. diff --git a/src/global.c b/src/global.c index ca0e503d..543b2c82 100644 --- a/src/global.c +++ b/src/global.c @@ -313,6 +313,7 @@ const sc *first_sc_for(int menu, void (*func)(void)) const sc *s; const sc *fkeysc = NULL; const sc *metasc = NULL; + const sc *rawsc = NULL; for (s = sclist; s != NULL; s = s->next) { if ((s->menu & menu) && s->scfunc == func) { @@ -329,6 +330,10 @@ const sc *first_sc_for(int menu, void (*func)(void)) if (!metasc) metasc = s; continue; + } else if (s->type == RAWINPUT) { + if (!rawsc) + rawsc = s; + continue; } /* Otherwise, it was something else, so use it. */ @@ -339,11 +344,14 @@ const sc *first_sc_for(int menu, void (*func)(void)) /* If we're here, we may have found only function keys or meta * sequences. If so, use one, with the same priority as in the * help browser: function keys come first, unless meta sequences are - * available, in which case meta sequences come first. */ + * available, in which case meta sequences come first. Last choice + * is the raw key. */ if (fkeysc && !metasc) return fkeysc; else if (metasc) return metasc; + else if (rawsc) + return rawsc; #ifdef DEBUG fprintf(stderr, "Whoops, returning null given func %ld in menu %d\n", (long) func, menu);