repro.vim):set wrap set linebreak set breakindent set breakindentopt+=shift:4 call append(0, ["a b", "c d"]) normal! 2gg call prop_type_add( 'Normal' , {'highlight': 'Normal'} ) call prop_add( 1 , 0 , {'type': 'Normal', 'text': '123', 'text_align': 'above'} )
vim --clean:source repro.vimVim should show the content like:
123
a b
c d
9.0.1833
OS: Fedora 38
Terminal: Windows Terminal (using ssh to connect to the Fedora)
Value of $TERM: xterm-256color
Shell: zsh 5.9
No response
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
The actual content after source looks like:
123
a b
c d
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
After some bisect, it looks like that b557f48 ("patch 9.0.1783: Display issues with virt text smoothscroll and showbreak") causes the issue
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
It seems that the cursor position is also incorrect without 'linebreak'.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
This fixes the redrawing problem, but not cursor position:
diff --git a/src/charset.c b/src/charset.c index 3495a0ee1..f218c42b1 100644 --- a/src/charset.c +++ b/src/charset.c @@ -1126,8 +1126,11 @@ win_lbr_chartabsize( #endif #if defined(FEAT_PROP_POPUP) - cts->cts_cur_text_width = 0; - cts->cts_first_char = 0; + if (cts->cts_has_prop_with_text) + { + cts->cts_cur_text_width = 0; + cts->cts_first_char = 0; + } #endif #if defined(FEAT_LINEBREAK) || defined(FEAT_PROP_POPUP) @@ -1264,7 +1267,7 @@ win_lbr_chartabsize( int width2 = wp->w_width - col_off_prev + win_col_off2(wp); colnr_T wcol = vcol + col_off_prev; #ifdef FEAT_PROP_POPUP - wcol -= wp->w_virtcol_first_char; + wcol -= cts->cts_first_char; #endif colnr_T max_head_vcol = cts->cts_max_head_vcol; int added = 0; diff --git a/src/drawline.c b/src/drawline.c index 63bc96c4d..3bac16155 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -2879,8 +2879,14 @@ win_line( char_u *p = ptr - (mb_off + 1); chartabsize_T cts; + init_chartabsize_arg(&cts, wp, lnum, 0, line, line); + (void)win_lbr_chartabsize(&cts, NULL); + colnr_T cts_first_char = cts.cts_first_char; + clear_chartabsize_arg(&cts); + init_chartabsize_arg(&cts, wp, lnum, wlv.vcol, line, p); # ifdef FEAT_PROP_POPUP + cts.cts_first_char = cts_first_char; // do not want virtual text counted here cts.cts_has_prop_with_text = FALSE; # endif
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
And this fixes the cursor position without 'linebreak':
diff --git a/src/charset.c b/src/charset.c index 3495a0ee1..27539dd27 100644 --- a/src/charset.c +++ b/src/charset.c @@ -1218,8 +1218,9 @@ win_lbr_chartabsize( cts->cts_cur_text_width += cells; if (tp->tp_flags & TP_FLAG_ALIGN_ABOVE) cts->cts_first_char += cells; + else + size += cells; cts->cts_start_incl = tp->tp_flags & TP_FLAG_START_INCL; - size += cells; if (*s == TAB) { // tab size changes because of the inserted text @@ -1385,6 +1386,9 @@ win_lbr_chartabsize( } } +# ifdef FEAT_PROP_POPUP + size += cts->cts_first_char; +# endif return size; # endif #endif
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@zeertzjq Thanks for your quick reply! I have tested in my own env and it works! And the patch fixes the issue I mentioned in #12999 too.
Is there any plan to open a PR for the fix?
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I'll create a PR soon, after writing tests.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Emm, only the script in #12999 can't reproduce but the issue is still existing. Maybe I shall write a new script to reproduce the issue in #12999 .
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
should be fixed by ce53e3e
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Closed #12998 as completed.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()