summaryrefslogtreecommitdiffstats
path: root/src/charset.c
diff options
context:
space:
mode:
authorDylan Thacker-Smith <dylan.ah.smith@gmail.com>2024-02-27 20:25:10 +0100
committerChristian Brabandt <cb@256bit.org>2024-02-27 20:25:10 +0100
commitda0c9137d1ec96f4d79b818502d2f921a21f710e (patch)
tree79e1c6838139886a8181e692ba6269de2ca09c65 /src/charset.c
parente84d2d4432cd6e43f2bb300d02abc90d551bcf4a (diff)
patch 9.1.0140: cursor on wrong row after 1 char 'below' virtual text when EOL is shownv9.1.0140
Problem: The cursor screen row was incorrectly being calculated when the cursor follows a 1 character text_align 'below' virtual text line, resulting in the cursor being shown on the wrong line. This was caused by a cell size of 2 instead of 1 being used for the EOL character, which propagated to the calculation of space for putting the 'below' virtual text on its own line. (rickhowe) Solution: Fix the size used for the EOL character in calculating the cursor's screen position (Dylan Thacker-Smith) fixes: #11959 related: #12028 closes: #14096 Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/charset.c')
-rw-r--r--src/charset.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/charset.c b/src/charset.c
index 919885df07..9f4c0ae828 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1160,8 +1160,12 @@ win_lbr_chartabsize(
* First get the normal size, without 'linebreak' or text properties
*/
size = win_chartabsize(wp, s, vcol);
- if (*s == NUL && !has_lcs_eol)
- size = 0; // NUL is not displayed
+ if (*s == NUL)
+ {
+ // 1 cell for EOL list char (if present), as opposed to the two cell ^@
+ // for a NUL character in the text.
+ size = has_lcs_eol ? 1 : 0;
+ }
# ifdef FEAT_LINEBREAK
int is_doublewidth = has_mbyte && size == 2 && MB_BYTE2LEN(*s) > 1;
# endif