commit 9c9de85afb15f2bf2e6b031dced1d12af922856c
parent addac49465f37cc0ec633e78f059e1b28a5f4f93
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 22 Nov 2021 12:03:28 +0100
tweaks: elide a variable that is confusing and has just one use case
Diffstat:
6 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/src/global.c b/src/global.c
@@ -80,8 +80,6 @@ linestruct *pletion_line = NULL;
bool also_the_last = FALSE;
/* Whether indenting/commenting should include the last line of
* the marked region. */
-bool hide_cursor = FALSE;
- /* Whether to suppress the cursor when highlighting a search match. */
char *answer = NULL;
/* The answer string used by the status-bar prompt. */
diff --git a/src/help.c b/src/help.c
@@ -469,7 +469,6 @@ void show_help(void)
#ifndef NANO_TINY
spotlighted = FALSE;
- hide_cursor = FALSE;
if (bracketed_paste || kbinput == BRACKETED_PASTE_MARKER) {
beep();
diff --git a/src/nano.c b/src/nano.c
@@ -1531,7 +1531,6 @@ void process_a_keystroke(void)
input = get_kbinput(edit, VISIBLE);
lastmessage = VACUUM;
- hide_cursor = FALSE;
#ifndef NANO_TINY
if (input == KEY_WINCH)
diff --git a/src/prototypes.h b/src/prototypes.h
@@ -53,7 +53,6 @@ extern message_type lastmessage;
extern linestruct *pletion_line;
extern bool also_the_last;
-extern bool hide_cursor;
extern char *answer;
diff --git a/src/search.c b/src/search.c
@@ -327,8 +327,6 @@ int findnextstr(const char *needle, bool whole_word_only, int modus,
spotlighted = TRUE;
light_from_col = xplustabs();
light_to_col = wideness(line->data, found_x + found_len);
- if (!ISSET(SHOW_CURSOR))
- hide_cursor = TRUE;
edit_refresh();
}
#endif
diff --git a/src/winio.c b/src/winio.c
@@ -189,7 +189,8 @@ void read_keys_from(WINDOW *win)
/* Before reading the first keycode, display any pending screen updates. */
doupdate();
- if (reveal_cursor && !hide_cursor && (LINES > 1 || lastmessage <= HUSH))
+ if (reveal_cursor && (!spotlighted || ISSET(SHOW_CURSOR || currmenu == MSPELL)) &&
+ (LINES > 1 || lastmessage <= HUSH))
curs_set(1);
#ifndef NANO_TINY