@@ -666,6 +666,7 @@ 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
@@ -1784,6 +1785,7 @@ win_line(
17841785
17851786 // Sort the properties on priority and/or starting last.
17861787 // Then combine the attributes, highest priority last.
1788+ text_prop_above = FALSE;
17871789 text_prop_follows = FALSE;
17881790 sort_text_props (wp -> w_buffer , text_props ,
17891791 text_prop_idxs , text_props_active );
@@ -1817,6 +1819,8 @@ win_line(
18171819 char_u * p = ((char_u * * )wp -> w_buffer
18181820 -> b_textprop_text .ga_data )[
18191821 - text_prop_id - 1 ];
1822+ int above = (tp -> tp_flags
1823+ & TP_FLAG_ALIGN_ABOVE );
18201824
18211825 // reset the ID in the copy to avoid it being used
18221826 // again
@@ -1826,8 +1830,6 @@ win_line(
18261830 {
18271831 int right = (tp -> tp_flags
18281832 & TP_FLAG_ALIGN_RIGHT );
1829- int above = (tp -> tp_flags
1830- & TP_FLAG_ALIGN_ABOVE );
18311833 int below = (tp -> tp_flags
18321834 & TP_FLAG_ALIGN_BELOW );
18331835 int wrap = (tp -> tp_flags & TP_FLAG_WRAP );
@@ -1902,6 +1904,9 @@ win_line(
19021904
19031905 // If another text prop follows the condition below at
19041906 // the last window column must know.
1907+ // If this is an "above" text prop and 'nowrap' the we
1908+ // must wrap anyway.
1909+ text_prop_above = above ;
19051910 text_prop_follows = other_tpi != -1 ;
19061911 }
19071912 }
@@ -3581,7 +3586,7 @@ win_line(
35813586 || filler_todo > 0
35823587#endif
35833588#ifdef FEAT_PROP_POPUP
3584- || text_prop_follows
3589+ || text_prop_above || text_prop_follows
35853590#endif
35863591 || (wp -> w_p_list && wp -> w_lcs_chars .eol != NUL
35873592 && wlv .p_extra != at_end_str )
@@ -3608,12 +3613,12 @@ win_line(
36083613 && filler_todo <= 0
36093614#endif
36103615#ifdef FEAT_PROP_POPUP
3611- && !text_prop_follows
3616+ && !text_prop_above && ! text_prop_follows
36123617#endif
36133618 ) || lcs_eol_one == -1 )
36143619 break ;
36153620#ifdef FEAT_PROP_POPUP
3616- if (!wp -> w_p_wrap && text_prop_follows )
3621+ if (!wp -> w_p_wrap && text_prop_follows && ! text_prop_above )
36173622 {
36183623 // do not output more of the line, only the "below" prop
36193624 ptr += STRLEN (ptr );
@@ -3647,7 +3652,7 @@ win_line(
36473652 && filler_todo <= 0
36483653#endif
36493654#ifdef FEAT_PROP_POPUP
3650- && !text_prop_follows
3655+ && !text_prop_above && ! text_prop_follows
36513656#endif
36523657 && wp -> w_width == Columns )
36533658 {
0 commit comments