diff --git a/ChangeLog b/ChangeLog index 9056ad6c787e7de342d3d2da5031fc5bd116c9ad..d7cc89deaee5529b76021fe57ef850b26ea7bc7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ been working for a dozen years. * src/winio.c (statusbar): Update the screen immediately whenever a message has been posted on the status bar. + * src/winio.c (statusbar), src/nano.c (do_input): Turn the cursor off + when writing in the status bar, and on when waiting for input. 2016-02-05 Benno Schulenberg <bensberg@justemail.net> * doc/texinfo/nano.texi: Condense the descriptions of command-key diff --git a/src/nano.c b/src/nano.c index 2cbf7051dafa6445563d3dce2b5f83dbc32cc953..164b40d1f76a4b7d5693103b38e74622512200f2 100644 --- a/src/nano.c +++ b/src/nano.c @@ -1346,9 +1346,6 @@ RETSIGTYPE do_continue(int signal) /* Restore the terminal to its previous state. */ terminal_init(); - /* Turn the cursor back on for sure. */ - curs_set(1); - /* Redraw the contents of the windows that need it. */ blank_statusbar(); wnoutrefresh(bottomwin); @@ -1407,9 +1404,6 @@ void regenerate_screen(void) /* Restore the terminal to its previous state. */ terminal_init(); - /* Turn the cursor back on for sure. */ - curs_set(1); - /* Do the equivalent of what both mutt and Minimum Profit do: * Reinitialize all the windows based on the new screen * dimensions. */ @@ -1610,6 +1604,9 @@ int do_input(bool allow_funcs) const sc *s; bool have_shortcut; + /* Turn the cursor on when waiting for input. */ + curs_set(1); + /* Read in a character. */ input = get_kbinput(edit); @@ -2534,9 +2531,6 @@ int main(int argc, char **argv) /* Set up the terminal state. */ terminal_init(); - /* Turn the cursor on for sure. */ - curs_set(1); - #ifdef DEBUG fprintf(stderr, "Main: set up windows\n"); #endif diff --git a/src/text.c b/src/text.c index 9dacb9dd68b4809abb29f0a19dd20fa9c57524eb..8c6601aea6219924f18ecb53493d91949eee876d 100644 --- a/src/text.c +++ b/src/text.c @@ -2755,9 +2755,6 @@ const char *do_alt_speller(char *tempfile_name) /* Restore the terminal to its previous state. */ terminal_init(); - /* Turn the cursor back on for sure. */ - curs_set(1); - if (!WIFEXITED(alt_spell_status) || WEXITSTATUS(alt_spell_status) != 0) { #ifndef NANO_TINY /* Turn the mark back on if it was on before. */ @@ -3300,9 +3297,6 @@ void do_formatter(void) /* Restore the terminal to its previous state. */ terminal_init(); - /* Turn the cursor back on for sure. */ - curs_set(1); - if (!WIFEXITED(format_status) || WEXITSTATUS(format_status) != 0) finalstatus = invocation_error(openfile->syntax->formatter); else { diff --git a/src/winio.c b/src/winio.c index 016c5776c57b30eeeafc61777c536d074bd61645..21a4a6c23c33116756851d741d6d7766f248b067 100644 --- a/src/winio.c +++ b/src/winio.c @@ -2117,6 +2117,9 @@ void statusbar(const char *msg, ...) return; } + /* Turn the cursor off while fiddling in the statusbar. */ + curs_set(0); + blank_statusbar(); bar = charalloc(mb_cur_max() * (COLS - 3));