commit 92c97c70d41bc9ce46ce060b502535da89363813
parent b77b1391c3d50f3c32b5a98f0aea29e940ada66f
Author: Benno Schulenberg <bensberg@justemail.net>
Date: Fri, 26 Aug 2016 21:29:53 +0200
prompt: leave always at least the last character of the answer visible
This fixes https://savannah.gnu.org/bugs/?48912.
Diffstat:
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/prompt.c b/src/prompt.c
@@ -431,11 +431,12 @@ size_t statusbar_xplustabs(void)
* get_statusbar_page_start(column) < COLS). */
size_t get_statusbar_page_start(size_t start_col, size_t column)
{
- if (column == start_col || column < COLS - 1 || COLS == start_col + 1)
+ if (column == start_col || column < COLS - 1)
return 0;
+ else if (COLS > start_col + 2)
+ return column - start_col - 1 - (column - start_col - 1) % (COLS - start_col - 2);
else
- return column - start_col - (column - start_col) % (COLS -
- start_col - 1);
+ return column - 2;
}
/* Reinitialize the cursor position in the status bar prompt. */
@@ -724,7 +725,8 @@ int do_prompt(bool allow_tabs,
va_start(ap, msg);
vsnprintf(prompt, COLS * mb_cur_max(), msg, ap);
va_end(ap);
- null_at(&prompt, actual_x(prompt, (COLS < 4) ? 0 : COLS - 4));
+ /* Reserve five columns for colon plus dollars plus answer, ":$aa$". */
+ null_at(&prompt, actual_x(prompt, (COLS < 5) ? 0 : COLS - 5));
func = acquire_an_answer(&retval, allow_tabs,
#ifndef DISABLE_TABCOMP