commit 4416d9c941ce0e5ebaec06984ee58a8b1b561347
parent c073c5ae543f085464ebcc34e3afb52cbef0e515
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Sun, 24 Jul 2016 13:15:45 +0200
tweaks: shuffle the resetting of a counter to the tail of the routine
Diffstat:
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/winio.c b/src/winio.c
@@ -1290,11 +1290,8 @@ long get_unicode_kbinput(WINDOW *win, int kbinput)
break;
}
- /* If we have a full result, reset the Unicode digit counter. */
- if (retval != ERR)
- uni_digits = 0;
/* Show feedback only when editing, not when at a prompt. */
- else if (win == edit) {
+ if (retval == ERR && win == edit) {
char partial[7] = "......";
/* Construct the partial result, right-padding it with dots. */
@@ -1307,9 +1304,14 @@ long get_unicode_kbinput(WINDOW *win, int kbinput)
}
#ifdef DEBUG
- fprintf(stderr, "get_unicode_kbinput(): kbinput = %d, uni_digits = %d, uni = %ld, retval = %ld\n", kbinput, uni_digits, uni, retval);
+ fprintf(stderr, "get_unicode_kbinput(): kbinput = %d, uni_digits = %d, uni = %ld, retval = %ld\n",
+ kbinput, uni_digits, uni, retval);
#endif
+ /* If we have an end result, reset the Unicode digit counter. */
+ if (retval != ERR)
+ uni_digits = 0;
+
return retval;
}
#endif /* ENABLE_UTF8 */