Using the more direct func_from_key() wrapper instead of get_shortcut().

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5082 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Benno Schulenberg 2014-07-27 19:32:03 +00:00
parent dbb5e7cd8e
commit 266e0496ab
2 changed files with 6 additions and 4 deletions

View File

@ -3,6 +3,8 @@
addition ability from this builder function of the shortcut list. addition ability from this builder function of the shortcut list.
* src/global.c (strtokeytype): Move this to a better place. * src/global.c (strtokeytype): Move this to a better place.
* src/global.c (first_sc_for): Move this too to a better place. * src/global.c (first_sc_for): Move this too to a better place.
* src/prompt.c (do_yesno_prompt): Use the new and more direct
func_from_key() wrapper instead of get_shortcut().
2014-07-24 Jordi Mallach <jordi@gnu.org> 2014-07-24 Jordi Mallach <jordi@gnu.org>
* doc/texinfo/nano.texi, doc/man/nanorc.5: Typo fix. * doc/texinfo/nano.texi, doc/man/nanorc.5: Typo fix.

View File

@ -1045,7 +1045,6 @@ int do_yesno_prompt(bool all, const char *msg)
const char *yesstr; /* String of Yes characters accepted. */ const char *yesstr; /* String of Yes characters accepted. */
const char *nostr; /* Same for No. */ const char *nostr; /* Same for No. */
const char *allstr; /* And All, surprise! */ const char *allstr; /* And All, surprise! */
const sc *s;
int oldmenu = currmenu; int oldmenu = currmenu;
assert(msg != NULL); assert(msg != NULL);
@ -1106,15 +1105,16 @@ int do_yesno_prompt(bool all, const char *msg)
do { do {
int kbinput; int kbinput;
functionptrtype func;
#ifndef DISABLE_MOUSE #ifndef DISABLE_MOUSE
int mouse_x, mouse_y; int mouse_x, mouse_y;
#endif #endif
currmenu = MYESNO; currmenu = MYESNO;
kbinput = get_kbinput(bottomwin); kbinput = get_kbinput(bottomwin);
s = get_shortcut(&kbinput); func = func_from_key(&kbinput);
if (s && s->scfunc == do_cancel) if (func == do_cancel)
ok = -1; ok = -1;
#ifndef DISABLE_MOUSE #ifndef DISABLE_MOUSE
else if (kbinput == KEY_MOUSE) { else if (kbinput == KEY_MOUSE) {
@ -1146,7 +1146,7 @@ int do_yesno_prompt(bool all, const char *msg)
} }
} }
#endif /* !DISABLE_MOUSE */ #endif /* !DISABLE_MOUSE */
else if (s && s->scfunc == total_refresh) { else if (func == total_refresh) {
total_redraw(); total_redraw();
continue; continue;
} else { } else {