Commit 5df47bfe authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

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.
parent fb51d617
Showing with 12 additions and 5 deletions
+12 -5
......@@ -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;
......
......@@ -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;
......
......@@ -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. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment