Commit f7c68cd1 authored by Chris Allegretta's avatar Chris Allegretta
Browse files

2014-03-04 Chris Allegretta <chrisa@asty.org>

        * 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
parent 1a1b2a0c
No related merge requests found
Showing with 14 additions and 1 deletion
+14 -1
2014-03-04 Chris Allegretta <chrisa@asty.org>
* 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 <bensberg@justemail.net> 2014-03-04 Benno Schulenberg <bensberg@justemail.net>
* doc/syntax/nanorc.nanorc - Add keyword 'quiet', sort 'locking', * doc/syntax/nanorc.nanorc - Add keyword 'quiet', sort 'locking',
and concatenate the two separate strings into one. and concatenate the two separate strings into one.
......
...@@ -313,6 +313,7 @@ const sc *first_sc_for(int menu, void (*func)(void)) ...@@ -313,6 +313,7 @@ const sc *first_sc_for(int menu, void (*func)(void))
const sc *s; const sc *s;
const sc *fkeysc = NULL; const sc *fkeysc = NULL;
const sc *metasc = NULL; const sc *metasc = NULL;
const sc *rawsc = NULL;
for (s = sclist; s != NULL; s = s->next) { for (s = sclist; s != NULL; s = s->next) {
if ((s->menu & menu) && s->scfunc == func) { if ((s->menu & menu) && s->scfunc == func) {
...@@ -329,6 +330,10 @@ const sc *first_sc_for(int menu, void (*func)(void)) ...@@ -329,6 +330,10 @@ const sc *first_sc_for(int menu, void (*func)(void))
if (!metasc) if (!metasc)
metasc = s; metasc = s;
continue; continue;
} else if (s->type == RAWINPUT) {
if (!rawsc)
rawsc = s;
continue;
} }
/* Otherwise, it was something else, so use it. */ /* Otherwise, it was something else, so use it. */
...@@ -339,11 +344,14 @@ const sc *first_sc_for(int menu, void (*func)(void)) ...@@ -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 /* 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 * sequences. If so, use one, with the same priority as in the
* help browser: function keys come first, unless meta sequences are * 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) if (fkeysc && !metasc)
return fkeysc; return fkeysc;
else if (metasc) else if (metasc)
return metasc; return metasc;
else if (rawsc)
return rawsc;
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "Whoops, returning null given func %ld in menu %d\n", (long) func, menu); fprintf(stderr, "Whoops, returning null given func %ld in menu %d\n", (long) func, menu);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment