From d2d0c665b14aa63097c52408080c0e17f6f03399 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Thu, 10 Sep 2020 18:27:04 +0200 Subject: [PATCH] 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. --- src/files.c | 4 ++++ src/nano.c | 4 ++++ src/winio.c | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/src/files.c b/src/files.c index 4e0f3fbf..f882f390 100644 --- 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 index 55b97d65..17ee0946 100644 --- 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 index 6e3b6228..55f707dd 100644 --- 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. */