aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/plines.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-02-14 07:21:45 +0800
committerGitHub <noreply@github.com>2025-02-13 23:21:45 +0000
commit9f85dace94d2682f076ede824d3516cdf779ff7b (patch)
treec68afb77088206a0229731aa1feae600d80c1774 /src/nvim/plines.c
parent93480f7fbaa5b4e5418d95dd35005daa6142dbb9 (diff)
downloadrneovim-9f85dace94d2682f076ede824d3516cdf779ff7b.tar.gz
rneovim-9f85dace94d2682f076ede824d3516cdf779ff7b.tar.bz2
rneovim-9f85dace94d2682f076ede824d3516cdf779ff7b.zip
vim-patch:9.1.1108: 'smoothscroll' gets stuck with 'listchars' "eol" (#32434)
Problem: 'smoothscroll' gets stuck with 'listchars' "eol". Solution: Count size of 'listchars' "eol" in line size when scrolling. (zeertzjq) related: neovim/neovim#32405 closes: vim/vim#16627 https://github.com/vim/vim/commit/2c47ab8fcd7188fa87053c757ea86b0d846c06c1
Diffstat (limited to 'src/nvim/plines.c')
-rw-r--r--src/nvim/plines.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/plines.c b/src/nvim/plines.c
index e084d107a0..4d1cf80e77 100644
--- a/src/nvim/plines.c
+++ b/src/nvim/plines.c
@@ -75,11 +75,19 @@ int linetabsize_col(int startvcol, char *s)
/// Return the number of cells line "lnum" of window "wp" will take on the
/// screen, taking into account the size of a tab and inline virtual text.
+/// Doesn't count the size of 'listchars' "eol".
int linetabsize(win_T *wp, linenr_T lnum)
{
return win_linetabsize(wp, lnum, ml_get_buf(wp->w_buffer, lnum), MAXCOL);
}
+/// Like linetabsize(), but counts the size of 'listchars' "eol".
+int linetabsize_eol(win_T *wp, linenr_T lnum)
+{
+ return linetabsize(wp, lnum)
+ + ((wp->w_p_list && wp->w_p_lcs_chars.eol != NUL) ? 1 : 0);
+}
+
static const uint32_t inline_filter[4] = {[kMTMetaInline] = kMTFilterSelect };
/// Prepare the structure passed to charsize functions.