* 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.
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. */
/* 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.
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();
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. */