Removing a now unneeded function, as nothing can break out of do_prompt()

any more, not a SIGWINCH either.  And deleting an always-FALSE 'if'.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5577 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg 2016-01-21 18:23:17 +00:00
parent aa7edb7fc2
commit 7a1709f03b
3 changed files with 3 additions and 31 deletions

View File

@ -2,6 +2,9 @@
* src/prompt.c (get_prompt_string): Preserve the cursor position on
the statusbar when just toggling a setting or making an excursion to
the file browser. This fixes Savannah bug #46945.
* src/prompt.c (do_prompt_abort): Remove this unneeded function, as
nothing can break out of do_prompt(), not a SIGWINCH either.
* src/prompt.c (get_prompt_string): Delete code that is dead now.
2016-01-20 Benno Schulenberg <bensberg@justemail.net>
* src/files.c (open_buffer): Readjust the indentation and a comment.

View File

@ -2683,10 +2683,6 @@ int main(int argc, char **argv)
reset_cursor();
wnoutrefresh(edit);
/* Just in case we were at the statusbar prompt, make sure the
* statusbar cursor position is reset. */
do_prompt_abort();
/* If constant cursor position display is on, and there are no
* keys waiting in the input buffer, display the current cursor
* position on the statusbar. */

View File

@ -37,9 +37,6 @@ static size_t old_statusbar_x = (size_t)-1;
/* The old cursor position in answer, if any. */
static size_t old_pww = (size_t)-1;
/* The old place we want in answer, if any. */
static bool reset_statusbar_x = FALSE;
/* Should we reset the cursor position at the statusbar
* prompt? */
/* Read in a character, interpret it as a shortcut or toggle if
* necessary, and return it.
@ -761,19 +758,6 @@ functionptrtype get_prompt_string(int *actual, bool allow_tabs,
answer = mallocstrcpy(answer, curranswer);
curranswer_len = strlen(answer);
/* If reset_statusbar_x is TRUE, restore statusbar_x and
* statusbar_pww to what they were before this prompt. Then, if
* statusbar_x is uninitialized or past the end of curranswer, put
* statusbar_x at the end of the string and update statusbar_pww
* based on it. We do these things so that the cursor position
* stays at the right place if a prompt-changing toggle is pressed,
* or if this prompt was started from another prompt and we cancel
* out of it. */
if (reset_statusbar_x) {
statusbar_x = old_statusbar_x;
statusbar_pww = old_pww;
}
if (statusbar_x == (size_t)-1 || statusbar_x > curranswer_len) {
statusbar_x = curranswer_len;
statusbar_pww = statusbar_xplustabs();
@ -1019,17 +1003,6 @@ int do_prompt(bool allow_tabs,
return retval;
}
/* This function forces a reset of the statusbar cursor position. It
* 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;
}
/* Ask a simple Yes/No (and optionally All) question, specified in msg,
* on the statusbar. Return 1 for Yes, 0 for No, 2 for All (if all is
* TRUE when passed in), and -1 for Cancel. */