aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-01-18 07:27:00 +0800
committerGitHub <noreply@github.com>2024-01-18 07:27:00 +0800
commit5b314478113754e46de40a9cdc6909e4415fe2d5 (patch)
tree2d54acb9e32e48e80df1da19d6cdbede57543158 /src
parent8a07ca6c4baf9a72476df4b1851aa33165b4f9c5 (diff)
downloadrneovim-5b314478113754e46de40a9cdc6909e4415fe2d5.tar.gz
rneovim-5b314478113754e46de40a9cdc6909e4415fe2d5.tar.bz2
rneovim-5b314478113754e46de40a9cdc6909e4415fe2d5.zip
fix(drawline): update prev_ptr after getting syntax attrs (#27072)
Diffstat (limited to 'src')
-rw-r--r--src/nvim/drawline.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index e8c41cb608..7fe7e6f403 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -1923,6 +1923,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s
// Get extmark and syntax attributes, unless still at the start of the line
// (double-wide char that doesn't fit).
v = ptr - line;
+ const ptrdiff_t prev_v = prev_ptr - line;
if (has_syntax && v > 0) {
// Get the syntax attribute for the character. If there
// is an error, disable syntax highlighting.
@@ -1947,6 +1948,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s
// have made it invalid.
line = ml_get_buf(wp->w_buffer, lnum);
ptr = line + v;
+ prev_ptr = line + prev_v;
// no concealing past the end of the line, it interferes
// with line highlighting.