go back to using a while loop in get_prompt_string(), as it's simpler
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3291 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
162ed2af24
commit
8326254643
|
@ -41,9 +41,6 @@ CVS code -
|
||||||
file browser shortcut list. (DLR)
|
file browser shortcut list. (DLR)
|
||||||
- prompt.c:
|
- prompt.c:
|
||||||
get_prompt_string()
|
get_prompt_string()
|
||||||
- Use a do/while loop instead of a while loop, for consistency,
|
|
||||||
and initialize finished to FALSE to make sure it works
|
|
||||||
properly. (DLR)
|
|
||||||
- Redraw the prompt and set finished to FALSE when NANO_HELP_KEY
|
- 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
|
is pressed, so that we don't leave the prompt, enter the help
|
||||||
browser, and restart the prompt after leaving it. This will
|
browser, and restart the prompt after leaving it. This will
|
||||||
|
|
10
src/prompt.c
10
src/prompt.c
|
@ -912,7 +912,7 @@ int get_prompt_string(bool allow_tabs,
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
int kbinput = ERR;
|
int kbinput = ERR;
|
||||||
bool meta_key, func_key, s_or_t, ran_func, finished = FALSE;
|
bool meta_key, func_key, s_or_t, ran_func, finished;
|
||||||
size_t curranswer_len;
|
size_t curranswer_len;
|
||||||
#ifndef DISABLE_TABCOMP
|
#ifndef DISABLE_TABCOMP
|
||||||
bool tabbed = FALSE;
|
bool tabbed = FALSE;
|
||||||
|
@ -961,7 +961,9 @@ int get_prompt_string(bool allow_tabs,
|
||||||
* to files not specified on the command line. In this case,
|
* to files not specified on the command line. In this case,
|
||||||
* disable all keys that would change the text if the filename isn't
|
* disable all keys that would change the text if the filename isn't
|
||||||
* blank and we're at the "Write File" prompt. */
|
* blank and we're at the "Write File" prompt. */
|
||||||
do {
|
while ((kbinput = do_statusbar_input(&meta_key, &func_key, &s_or_t,
|
||||||
|
&ran_func, &finished, TRUE)) != NANO_CANCEL_KEY && kbinput !=
|
||||||
|
NANO_ENTER_KEY) {
|
||||||
assert(statusbar_x <= strlen(answer));
|
assert(statusbar_x <= strlen(answer));
|
||||||
|
|
||||||
#ifndef DISABLE_TABCOMP
|
#ifndef DISABLE_TABCOMP
|
||||||
|
@ -1071,9 +1073,7 @@ int get_prompt_string(bool allow_tabs,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
reset_statusbar_cursor();
|
reset_statusbar_cursor();
|
||||||
} while ((kbinput = do_statusbar_input(&meta_key, &func_key,
|
}
|
||||||
&s_or_t, &ran_func, &finished, TRUE)) != NANO_CANCEL_KEY &&
|
|
||||||
kbinput != NANO_ENTER_KEY);
|
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
/* Set the current position in the history list to the bottom and
|
/* Set the current position in the history list to the bottom and
|
||||||
|
|
Loading…
Reference in New Issue