diff options
author | luukvbaal <luukvbaal@gmail.com> | 2023-05-21 13:00:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-21 19:00:37 +0800 |
commit | 60f69014a801891d084542cf98ba2aa0d476164a (patch) | |
tree | 01ac608cda5707e45832c8b5d11343cf1ae1d3a3 /src/nvim | |
parent | 387c8ceb287308d4631c41bdbd6cc51e4fb3950f (diff) | |
download | rneovim-60f69014a801891d084542cf98ba2aa0d476164a.tar.gz rneovim-60f69014a801891d084542cf98ba2aa0d476164a.tar.bz2 rneovim-60f69014a801891d084542cf98ba2aa0d476164a.zip |
fix(redraw): multibyte characters are wrapped at the end of a line (#23696)
Problem: Multibyte characters may be wrapped at the end of a line
when 'statuscolumn' and 'spell' are set.
Solution: Update line pointerdiff "v" before fetching the line pointer
after evaluating 'statuscolumn'.
Diffstat (limited to 'src/nvim')
-rw-r--r-- | src/nvim/drawline.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index e6cdf3d60d..dc90be36be 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -2,7 +2,7 @@ // it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com // drawline.c: Functions for drawing window lines on the screen. -// This is the middle level, drawscreen.c is the top and grid.c/screen.c the lower level. +// This is the middle level, drawscreen.c is the top and grid.c the lower level. #include <assert.h> #include <limits.h> @@ -1594,6 +1594,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool nochange, // Draw the 'statuscolumn' if option is set. if (statuscol.draw) { if (statuscol.textp == NULL) { + v = (ptr - line); get_statuscol_str(wp, lnum, wlv.row - startrow - wlv.filler_lines, &statuscol); if (!end_fill) { // Get the line again as evaluating 'statuscolumn' may free it. |