diff --git a/src/global.c b/src/global.c index 39cbe036..79b1e8ea 100644 --- a/src/global.c +++ b/src/global.c @@ -68,6 +68,9 @@ bool inhelp = FALSE; char *title = NULL; /* When not NULL: the title of the current help text. */ +int didfind = 0; + /* Whether the last search found something. */ + int controlleft, controlright, controlup, controldown, controlhome, controlend; #ifndef NANO_TINY int shiftcontrolleft, shiftcontrolright, shiftcontrolup, shiftcontroldown; diff --git a/src/help.c b/src/help.c index 97fab791..0d81fa4a 100644 --- a/src/help.c +++ b/src/help.c @@ -183,6 +183,7 @@ void do_help(void) while (TRUE) { lastmessage = HUSH; focusing = TRUE; + didfind = 0; kbinput = get_kbinput(edit); @@ -207,12 +208,9 @@ void do_help(void) } else if (func == do_search) { do_search(); bottombars(MHELP); - wnoutrefresh(bottomwin); - curs_set(1); } else if (func == do_research) { do_research(); currmenu = MHELP; - curs_set(1); #ifndef NANO_TINY } else if (kbinput == KEY_WINCH) { ; /* Nothing to do. */ @@ -229,6 +227,12 @@ void do_help(void) } else unbound_key(kbinput); + /* If we searched and found something, let the cursor show it. */ + if (didfind == 1) + curs_set(1); + else + curs_set(0); + edit_refresh(); location = 0; diff --git a/src/proto.h b/src/proto.h index d9a27910..484fdb5e 100644 --- a/src/proto.h +++ b/src/proto.h @@ -54,6 +54,8 @@ extern filestruct *pletion_line; extern bool inhelp; extern char *title; +extern int didfind; + extern int controlleft; extern int controlright; extern int controlup; diff --git a/src/search.c b/src/search.c index f62ae138..c90510d1 100644 --- a/src/search.c +++ b/src/search.c @@ -438,7 +438,6 @@ void go_looking(void) { filestruct *was_current = openfile->current; size_t was_current_x = openfile->current_x; - int didfind; #ifdef DEBUG clock_t start = clock(); #endif