commit d2d0c665b14aa63097c52408080c0e17f6f03399
parent 50aa3587d4051691f2042db48bb67b41f6a2c938
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Thu, 10 Sep 2020 18:27:04 +0200
display: force the cursor to reappear after a message (when using Slang)
For some reason, when running a tiny nano built with Slang on the bterm
of a Debian installer image, the cursor disappears when certain things
are written to the status bar. Make the cursor reappear by rewriting
the two help lines with dummy items (and then rewriting it again with
the normal menu in the central loop). Of course, this does not help
when the user uses -x or --nohelp to suppress the help lines, but at
least in the default setup the cursor doesn't get hidden now and then.
This mitigates https://savannah.gnu.org/bugs/?59091.
Bug existed since before version 2.2.4.
Diffstat:
3 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/src/files.c b/src/files.c
@@ -2293,6 +2293,10 @@ void do_savefile(void)
{
if (do_writeout(FALSE, FALSE) == 2)
close_and_go();
+#ifdef USE_SLANG
+ /* Work around a shy cursor -- https://sv.gnu.org/bugs/?59091. */
+ bottombars(MREPLACEWITH);
+#endif
}
/* Convert the tilde notation when the given path begins with ~/ or ~user/.
diff --git a/src/nano.c b/src/nano.c
@@ -1303,6 +1303,10 @@ void unbound_key(int code)
else
statusline(ALERT, _("Unbound key: %c"), code);
#endif
+#ifdef USE_SLANG
+ /* Work around a shy cursor -- https://sv.gnu.org/bugs/?59091. */
+ bottombars(MREPLACEWITH);
+#endif
}
#ifdef ENABLE_MOUSE
diff --git a/src/winio.c b/src/winio.c
@@ -3305,6 +3305,12 @@ void report_cursor_position(void)
_("line %zd/%zd (%d%%), col %zu/%zu (%d%%), char %zu/%zu (%d%%)"),
openfile->current->lineno, openfile->filebot->lineno, linepct,
column, fullwidth, colpct, sum, openfile->totsize, charpct);
+
+#ifdef USE_SLANG
+ /* Work around a shy cursor -- https://sv.gnu.org/bugs/?59091. */
+ bottombars(MREPLACEWITH);
+ bottombars(MMAIN);
+#endif
}
/* Highlight the text between the given two columns on the current line. */