diff --git a/ChangeLog b/ChangeLog index 6d9d570870c1367cd6ca43bb0f6fbe74f5837d1f..ff40029564b51bd1009444f669cd87e956e99824 100644 --- a/ChangeLog +++ b/ChangeLog @@ -43,6 +43,11 @@ CVS code - get_prompt_string() - Use a do/while loop instead of a while loop, for consistency. (DLR) + - Redraw the prompt and set finished to FALSE when NANO_HELP_KEY + is pressed, so that we don't leave the prompt, enter the help + browser, and restart the prompt after leaving it. This will + properly preserve the cursor position after doing the last of + these. (DLR) - utils.c: ngetdelim() - Do sanity checks manually again instead of in an assert, and diff --git a/src/prompt.c b/src/prompt.c index e31da89343bf96f533bb716fd42abff4c76dbcb3..61575d3da1696bd46072b0624afa291d1d5bef6b 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -1047,6 +1047,17 @@ int get_prompt_string(bool allow_tabs, } break; #endif /* !NANO_TINY */ +#ifndef DISABLE_HELP + case NANO_HELP_KEY: + update_statusbar_line(answer, statusbar_x); + + /* This key has a shortcut list entry when it's used to + * to go to the help browser, which means that finished + * has been set to TRUE. Set it back to FALSE here, so + * that we aren't kicked out of the statusbar prompt. */ + finished = FALSE; + break; +#endif /* !DISABLE_HELP */ } /* If we have a shortcut with an associated function, break out