display: avoid a jumpy cursor by redrawing bottom bars only when needed

The help lines need to be redrawn one step after a justification
(whether it has been undone or not, to replace "Unjustify" with
"Uncut" again for ^U), and after switching buffers (to update a
possibly changed tag for ^T).

This fixes https://savannah.gnu.org/bugs/?51455.
master
Benno Schulenberg 2017-07-13 10:55:02 +02:00
parent fb51d617fd
commit 5df47bfef6
3 changed files with 12 additions and 5 deletions

View File

@ -631,9 +631,14 @@ void switch_to_prevnext_buffer(bool to_next)
/* Update titlebar and multiline info to match the current buffer. */
prepare_for_display();
if (inhelp)
return;
/* Ensure that the main loop will redraw the help lines. */
currmenu = MMOST;
/* Indicate the switch on the statusbar. */
if (!inhelp)
statusline(HUSH, _("Switched to %s"),
statusline(HUSH, _("Switched to %s"),
((openfile->filename[0] == '\0') ?
_("New Buffer") : openfile->filename));
@ -677,7 +682,7 @@ bool close_buffer(void)
/* Close the file buffer we had open before. */
unlink_opennode(openfile->prev);
/* If only one buffer is open now, show Exit in the help lines. */
/* If now just one buffer remains open, show "Exit" in the help lines. */
if (openfile == openfile->next)
exitfunc->desc = exit_tag;

View File

@ -2613,7 +2613,8 @@ int main(int argc, char **argv)
}
#endif
display_main_list();
if (currmenu != MMAIN)
display_main_list();
lastmessage = HUSH;
as_an_at = TRUE;

View File

@ -2511,8 +2511,9 @@ void do_justify(bool full_justify)
blank_statusbar();
wnoutrefresh(bottomwin);
/* Show "Uncut" again in the help lines. */
/* Show "Uncut" again in the help lines, and force their redrawing. */
uncutfunc->desc = uncut_tag;
currmenu = MMOST;
}
/* Justify the current paragraph. */