diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-09 18:25:23 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-09 18:25:23 +0100 |
commit | 49a90792d950c51608d0459ef8699fe921070718 (patch) | |
tree | a4f212b416b59ac517fd1b7a0aec9775d0369c31 /src/misc1.c | |
parent | e428fa04a758cc87ea580c856a796e58e407504b (diff) |
patch 9.0.0179: cursor pos wrong with wrapping virtual text in empty linev9.0.0179
Problem: Cursor position wrong with wrapping virtual text in empty line.
Solution: Adjust handling of an empty line. (closes #10875)
Diffstat (limited to 'src/misc1.c')
-rw-r--r-- | src/misc1.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/misc1.c b/src/misc1.c index f3d90f876d..f4a313d416 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -399,11 +399,19 @@ plines_win_nofold(win_T *wp, linenr_T lnum) char_u *s; long col; int width; + chartabsize_T cts; s = ml_get_buf(wp->w_buffer, lnum, FALSE); - if (*s == NUL) // empty line - return 1; - col = win_linetabsize(wp, lnum, s, (colnr_T)MAXCOL); + init_chartabsize_arg(&cts, wp, lnum, 0, s, s); + if (*s == NUL +#ifdef FEAT_PROP_POPUP + && !cts.cts_has_prop_with_text +#endif + ) + return 1; // be quick for an empty line + win_linetabsize_cts(&cts, (colnr_T)MAXCOL); + clear_chartabsize_arg(&cts); + col = (int)cts.cts_vcol; /* * If list mode is on, then the '$' at the end of the line may take up one |