Fix bz66: Count number cannot be backspaced
... or at least partially fix it - ^H does now backspace. I can't be bothered to dive into the (n)curses raw-mode stuff.
This commit is contained in:
@@ -3874,6 +3874,7 @@ parse()
|
|||||||
#endif
|
#endif
|
||||||
register int foo;
|
register int foo;
|
||||||
boolean prezero = FALSE;
|
boolean prezero = FALSE;
|
||||||
|
boolean backspaced = FALSE;
|
||||||
|
|
||||||
multi = 0;
|
multi = 0;
|
||||||
context.move = 1;
|
context.move = 1;
|
||||||
@@ -3885,13 +3886,23 @@ parse()
|
|||||||
if (!Cmd.num_pad || (foo = readchar()) == 'n')
|
if (!Cmd.num_pad || (foo = readchar()) == 'n')
|
||||||
for (;;) {
|
for (;;) {
|
||||||
foo = readchar();
|
foo = readchar();
|
||||||
if (foo >= '0' && foo <= '9') {
|
if ((foo >= '0' && foo <= '9') || (foo == '\b')) {
|
||||||
multi = 10 * multi + foo - '0';
|
if (foo >= '0' && foo <= '9')
|
||||||
|
multi = 10 * multi + foo - '0';
|
||||||
|
else {
|
||||||
|
multi = multi / 10;
|
||||||
|
backspaced = TRUE;
|
||||||
|
}
|
||||||
if (multi < 0 || multi >= LARGEST_INT)
|
if (multi < 0 || multi >= LARGEST_INT)
|
||||||
multi = LARGEST_INT;
|
multi = LARGEST_INT;
|
||||||
if (multi > 9) {
|
if (multi > 9 || backspaced) {
|
||||||
clear_nhwindow(WIN_MESSAGE);
|
clear_nhwindow(WIN_MESSAGE);
|
||||||
Sprintf(in_line, "Count: %d", multi);
|
if (backspaced && !multi)
|
||||||
|
Sprintf(in_line, "Count: ");
|
||||||
|
else {
|
||||||
|
Sprintf(in_line, "Count: %d", multi);
|
||||||
|
backspaced = FALSE;
|
||||||
|
}
|
||||||
pline1(in_line);
|
pline1(in_line);
|
||||||
mark_synch();
|
mark_synch();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user