aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-02-28 07:28:48 +0800
committerGitHub <noreply@github.com>2024-02-28 07:28:48 +0800
commit7e46ff791c97b8cedd6b334329dfed175da47911 (patch)
treec4904dff86a5b68ee4b25b46cbda8d9ceb2dcc4c
parent63f9c2da9aab52fa698fcbfdbc58ffd41794d28a (diff)
downloadrneovim-7e46ff791c97b8cedd6b334329dfed175da47911.tar.gz
rneovim-7e46ff791c97b8cedd6b334329dfed175da47911.tar.bz2
rneovim-7e46ff791c97b8cedd6b334329dfed175da47911.zip
vim-patch:9.1.0140: cursor on wrong row after 1 char 'below' virtual text when EOL is shown (#27651)
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: vim/vim#11959 related: vim/vim#12028 closes: vim/vim#14096 https://github.com/vim/vim/commit/da0c9137d1ec96f4d79b818502d2f921a21f710e Co-authored-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com>
-rw-r--r--src/nvim/plines.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/plines.c b/src/nvim/plines.c
index 52d7ca9ca0..eca07f0144 100644
--- a/src/nvim/plines.c
+++ b/src/nvim/plines.c
@@ -136,8 +136,10 @@ CharSize charsize_regular(CharsizeArg *csarg, char *const cur, colnr_T const vco
int is_doublewidth = false;
if (use_tabstop) {
size = tabstop_padding(vcol, buf->b_p_ts, buf->b_p_vts_array);
- } else if (*cur == NUL && !has_lcs_eol) {
- size = 0;
+ } else if (*cur == 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;
} else if (cur_char < 0) {
size = kInvalidByteCells;
} else {