make sure that the statusbar cursor position is always properly reset

when we get out of all statusbar prompts


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3865 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2006-08-29 20:54:38 +00:00
parent 185dc6acd0
commit 3879528945
4 changed files with 16 additions and 13 deletions

View File

@ -1,4 +1,9 @@
CVS code -
- General:
- Make sure that the statusbar cursor position is always
properly reset when we get out of all statusbar prompts.
Changes to do_insertfile(), do_writeout(),
handle_sigwinch(), main(), and do_prompt_abort(). (DLR)
GNU nano 1.9.99pre1 - 2006.08.29
- General:

View File

@ -766,13 +766,11 @@ void do_insertfile(
if (tmp == NULL)
continue;
/* We have a file now. Indicate this. */
free(answer);
answer = tmp;
/* We have a file now. Indicate this and get out of the
* statusbar prompt cleanly. */
i = 0;
do_prompt_abort();
}
#endif
@ -1825,12 +1823,9 @@ int do_writeout(bool exiting)
if (tmp == NULL)
continue;
/* We have a file now. Indicate this. */
free(answer);
answer = tmp;
/* We have a file now. Get out of the statusbar prompt
* cleanly. */
do_prompt_abort();
} else
#endif /* !DISABLE_BROWSER */
#ifndef NANO_TINY

View File

@ -1088,10 +1088,6 @@ RETSIGTYPE handle_sigwinch(int signal)
COLS = win.ws_col;
LINES = win.ws_row;
/* Just in case we're in the statusbar prompt, reset the statusbar
* cursor position. */
do_prompt_abort();
/* If we've partitioned the filestruct, unpartition it now. */
if (filepart != NULL)
unpartition_filestruct(&filepart);
@ -2252,6 +2248,10 @@ int main(int argc, char **argv)
/* Read in and interpret characters. */
do_input(&meta_key, &func_key, &s_or_t, &ran_func, &finished,
TRUE);
/* Just in case we were in the statusbar prompt, reset the
* statusbar cursor position. */
do_prompt_abort();
}
/* We should never get here. */

View File

@ -1247,10 +1247,13 @@ int do_prompt(bool allow_tabs,
}
/* This function forces a reset of the statusbar cursor position. It
* should only be called after do_prompt(), and is only needed if we
* leave the prompt via something other than Cancel or Enter. */
* should be called when we get out of all statusbar prompts. */
void do_prompt_abort(void)
{
/* Uninitialize the old cursor position in answer. */
old_statusbar_x = (size_t)-1;
old_pww = (size_t)-1;
reset_statusbar_x = TRUE;
}