nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] [PATCH] display: scroll horizontally one column earlier


From: Benno Schulenberg
Subject: [Nano-devel] [PATCH] display: scroll horizontally one column earlier
Date: Sun, 3 Mar 2019 14:57:06 +0100

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);
 }
-- 
2.20.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]