From 85e895508b0d7086cf206679927fb44fa0fbf3a7 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 3 Mar 2019 14:50:43 +0100 Subject: [PATCH] display: scroll horizontally one column earlier In this way, for single-width characters, one can see what character is ahead of the cursor before actually moving the cursor to that position, and, for double-width characters, the cursor never sits on a placeholder but always shows the character that is actually there. This addresses https://savannah.gnu.org/bugs/?55716. --- src/utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils.c b/src/utils.c index da2adcdc..4b76f4a7 100644 --- a/src/utils.c +++ b/src/utils.c @@ -367,10 +367,10 @@ char *free_and_assign(char *dest, char *src) * get_page_start(column) < COLS). */ size_t get_page_start(size_t column) { - if (column < editwincols - 1 || ISSET(SOFTWRAP) || column == 0) + if (column + 2 < editwincols || ISSET(SOFTWRAP) || column == 0) return 0; else if (editwincols > 8) - return column - 7 - (column - 7) % (editwincols - 8); + return column - 6 - (column - 6) % (editwincols - 8); else return column - (editwincols - 2); }