search: suppress the cursor when highlighting a match
Having a block cursor present when highlighting a match... does not look nice. So... hide the cursor until the next keystroke, unless --showcursor or 'set showcursor' is used.master
parent
856a6ecde3
commit
caef3128eb
|
@ -80,6 +80,8 @@ linestruct *pletion_line = NULL;
|
||||||
bool also_the_last = FALSE;
|
bool also_the_last = FALSE;
|
||||||
/* Whether indenting/commenting should include the last line of
|
/* Whether indenting/commenting should include the last line of
|
||||||
* the marked region. */
|
* the marked region. */
|
||||||
|
bool hide_cursor = FALSE;
|
||||||
|
/* Whether to suppress the cursor when highlighting a search match. */
|
||||||
|
|
||||||
char *answer = NULL;
|
char *answer = NULL;
|
||||||
/* The answer string used by the status-bar prompt. */
|
/* The answer string used by the status-bar prompt. */
|
||||||
|
|
|
@ -457,6 +457,9 @@ void show_help(void)
|
||||||
|
|
||||||
/* Show the cursor when we searched and found something. */
|
/* Show the cursor when we searched and found something. */
|
||||||
kbinput = get_kbinput(edit, didfind == 1 || ISSET(SHOW_CURSOR));
|
kbinput = get_kbinput(edit, didfind == 1 || ISSET(SHOW_CURSOR));
|
||||||
|
|
||||||
|
openfile->mark = NULL;
|
||||||
|
hide_cursor = FALSE;
|
||||||
didfind = 0;
|
didfind = 0;
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
|
|
|
@ -1514,6 +1514,7 @@ void process_a_keystroke(void)
|
||||||
input = get_kbinput(edit, VISIBLE);
|
input = get_kbinput(edit, VISIBLE);
|
||||||
|
|
||||||
lastmessage = VACUUM;
|
lastmessage = VACUUM;
|
||||||
|
hide_cursor = FALSE;
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
if (input == KEY_WINCH)
|
if (input == KEY_WINCH)
|
||||||
|
|
|
@ -53,6 +53,7 @@ extern message_type lastmessage;
|
||||||
extern linestruct *pletion_line;
|
extern linestruct *pletion_line;
|
||||||
|
|
||||||
extern bool also_the_last;
|
extern bool also_the_last;
|
||||||
|
extern bool hide_cursor;
|
||||||
|
|
||||||
extern char *answer;
|
extern char *answer;
|
||||||
|
|
||||||
|
|
|
@ -327,6 +327,8 @@ int findnextstr(const char *needle, bool whole_word_only, int modus,
|
||||||
openfile->mark = line;
|
openfile->mark = line;
|
||||||
openfile->mark_x = found_x + found_len;
|
openfile->mark_x = found_x + found_len;
|
||||||
openfile->softmark = TRUE;
|
openfile->softmark = TRUE;
|
||||||
|
if (!ISSET(SHOW_CURSOR))
|
||||||
|
hide_cursor = TRUE;
|
||||||
shift_held = TRUE;
|
shift_held = TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -181,7 +181,7 @@ void read_keys_from(WINDOW *win)
|
||||||
/* Before reading the first keycode, display any pending screen updates. */
|
/* Before reading the first keycode, display any pending screen updates. */
|
||||||
doupdate();
|
doupdate();
|
||||||
|
|
||||||
if (reveal_cursor)
|
if (reveal_cursor && !hide_cursor)
|
||||||
curs_set(1);
|
curs_set(1);
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
|
|
Loading…
Reference in New Issue