curses followup
Some prompts were being overwritten by the message that followed. And clear_nhwindow(WIN_MESSAGE) gets called for just about every keystroke so try to reduce the overhead I unwittingly added. The "scroll up one line earlier than the next message" mentioned in the prior commit is much more obvious that I realized and prompt erasure might need to be redone.
This commit is contained in:
@@ -398,15 +398,27 @@ curses_count_window(const char *count_text)
|
|||||||
|
|
||||||
/* if most recent message (probably prompt leading to this instance of
|
/* if most recent message (probably prompt leading to this instance of
|
||||||
counting window) is going to be covered up, scroll mesgs up a line */
|
counting window) is going to be covered up, scroll mesgs up a line */
|
||||||
if (!counting && my + 1 >= border + messageh) {
|
if (!counting && my >= border + (messageh - 1)) {
|
||||||
scroll_window(MESSAGE_WIN);
|
scroll_window(MESSAGE_WIN);
|
||||||
/* last position within the message window */
|
if (messageh > 1) {
|
||||||
my = border + (messageh - 1) - 1;
|
/* handling for next message will behave as if we're currently
|
||||||
mx = border;
|
positioned at the end of next to last line of message window */
|
||||||
|
my = border + (messageh - 1) - 1;
|
||||||
|
mx = border + (messagew - 1); /* (0 + 80 - 1) or (1 + 78 - 1) */
|
||||||
|
} else {
|
||||||
|
/* for a one-line window, use beginning of only line instead */
|
||||||
|
my = mx = border; /* 0 or 1 */
|
||||||
|
}
|
||||||
/* wmove(curses_get_nhwin(MESSAGE_WIN), my, mx); -- not needed */
|
/* wmove(curses_get_nhwin(MESSAGE_WIN), my, mx); -- not needed */
|
||||||
}
|
}
|
||||||
counting = TRUE;
|
/* in case we're being called from clear_nhwindow(MESSAGE_WIN)
|
||||||
|
which gets called for every command keystroke; it sends an
|
||||||
|
empty string to get the scroll-up-one-line effect above and
|
||||||
|
we want to avoid the curses overhead for the operations below... */
|
||||||
|
if (!*count_text)
|
||||||
|
return;
|
||||||
|
|
||||||
|
counting = TRUE;
|
||||||
#ifdef PDCURSES
|
#ifdef PDCURSES
|
||||||
if (countwin)
|
if (countwin)
|
||||||
curses_destroy_win(countwin), countwin = NULL;
|
curses_destroy_win(countwin), countwin = NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user