@@ -666,9 +666,11 @@ win_line(
666666 // syntax_attr
667667 int text_prop_id = 0 ; // active property ID
668668 int text_prop_flags = 0 ;
669+ int text_prop_above = FALSE; // first doing virtual text above
669670 int text_prop_follows = FALSE; // another text prop to display
670671 int saved_search_attr = 0 ; // search_attr to be used when n_extra
671672 // goes to zero
673+ int saved_area_attr = 0 ; // idem for area_attr
672674#endif
673675#ifdef FEAT_SPELL
674676 int has_spell = FALSE; // this buffer has spell checking
@@ -1784,6 +1786,7 @@ win_line(
17841786
17851787 // Sort the properties on priority and/or starting last.
17861788 // Then combine the attributes, highest priority last.
1789+ text_prop_above = FALSE;
17871790 text_prop_follows = FALSE;
17881791 sort_text_props (wp -> w_buffer , text_props ,
17891792 text_prop_idxs , text_props_active );
@@ -1817,6 +1820,8 @@ win_line(
18171820 char_u * p = ((char_u * * )wp -> w_buffer
18181821 -> b_textprop_text .ga_data )[
18191822 - text_prop_id - 1 ];
1823+ int above = (tp -> tp_flags
1824+ & TP_FLAG_ALIGN_ABOVE );
18201825
18211826 // reset the ID in the copy to avoid it being used
18221827 // again
@@ -1826,8 +1831,6 @@ win_line(
18261831 {
18271832 int right = (tp -> tp_flags
18281833 & TP_FLAG_ALIGN_RIGHT );
1829- int above = (tp -> tp_flags
1830- & TP_FLAG_ALIGN_ABOVE );
18311834 int below = (tp -> tp_flags
18321835 & TP_FLAG_ALIGN_BELOW );
18331836 int wrap = (tp -> tp_flags & TP_FLAG_WRAP );
@@ -1844,8 +1847,12 @@ win_line(
18441847 extra_for_textprop = TRUE;
18451848 extra_attr = used_attr ;
18461849 n_attr = mb_charlen (p );
1850+ // restore search_attr and area_attr when n_extra
1851+ // is down to zero
18471852 saved_search_attr = search_attr ;
1848- search_attr = 0 ; // restore when n_extra is zero
1853+ saved_area_attr = area_attr ;
1854+ search_attr = 0 ;
1855+ area_attr = 0 ;
18491856 text_prop_attr = 0 ;
18501857 text_prop_attr_comb = 0 ;
18511858 if (* ptr == NUL )
@@ -1902,6 +1909,9 @@ win_line(
19021909
19031910 // If another text prop follows the condition below at
19041911 // the last window column must know.
1912+ // If this is an "above" text prop and 'nowrap' the we
1913+ // must wrap anyway.
1914+ text_prop_above = above ;
19051915 text_prop_follows = other_tpi != -1 ;
19061916 }
19071917 }
@@ -2198,6 +2208,8 @@ win_line(
21982208 in_linebreak = FALSE;
21992209 if (search_attr == 0 )
22002210 search_attr = saved_search_attr ;
2211+ if (area_attr == 0 && * ptr != NUL )
2212+ area_attr = saved_area_attr ;
22012213 }
22022214#endif
22032215 }
@@ -3585,7 +3597,7 @@ win_line(
35853597 || filler_todo > 0
35863598#endif
35873599#ifdef FEAT_PROP_POPUP
3588- || text_prop_follows
3600+ || text_prop_above || text_prop_follows
35893601#endif
35903602 || (wp -> w_p_list && wp -> w_lcs_chars .eol != NUL
35913603 && wlv .p_extra != at_end_str )
@@ -3612,12 +3624,12 @@ win_line(
36123624 && filler_todo <= 0
36133625#endif
36143626#ifdef FEAT_PROP_POPUP
3615- && !text_prop_follows
3627+ && !text_prop_above && ! text_prop_follows
36163628#endif
36173629 ) || lcs_eol_one == -1 )
36183630 break ;
36193631#ifdef FEAT_PROP_POPUP
3620- if (!wp -> w_p_wrap && text_prop_follows )
3632+ if (!wp -> w_p_wrap && text_prop_follows && ! text_prop_above )
36213633 {
36223634 // do not output more of the line, only the "below" prop
36233635 ptr += STRLEN (ptr );
@@ -3651,7 +3663,7 @@ win_line(
36513663 && filler_todo <= 0
36523664#endif
36533665#ifdef FEAT_PROP_POPUP
3654- && !text_prop_follows
3666+ && !text_prop_above && ! text_prop_follows
36553667#endif
36563668 && wp -> w_width == Columns )
36573669 {
0 commit comments