--bcol;
# endif
// Add any text property that starts in this column.
+ // With 'nowrap' and not in the first screen line only "below"
+ // text prop can show.
while (text_prop_next < text_prop_count
&& (text_props[text_prop_next].tp_col == MAXCOL
- ? *ptr == NUL
+ ? (*ptr == NUL
+ && (wp->w_p_wrap
+ || wlv.row == startrow
+ || (text_props[text_prop_next].tp_flags
+ & TP_FLAG_ALIGN_BELOW)))
: bcol >= text_props[text_prop_next].tp_col - 1))
{
if (bcol <= text_props[text_prop_next].tp_col - 1
vim_memset(l, ' ', added);
vim_strncpy(l + added, wlv.p_extra,
n_used);
- if (n_used < wlv.n_extra)
+ if (n_used < wlv.n_extra
+ && wp->w_p_wrap)
{
char_u *lp = l + added + n_used - 1;
}
else if (text_prop_next < text_prop_count
&& text_props[text_prop_next].tp_col == MAXCOL
- && *ptr != NUL
- && ptr[mb_ptr2len(ptr)] == NUL)
+ && ((*ptr != NUL && ptr[mb_ptr2len(ptr)] == NUL)
+ || (!wp->w_p_wrap
+ && wlv.col == wp->w_width - 1
+ && (text_props[text_prop_next].tp_flags
+ & TP_FLAG_ALIGN_BELOW))))
// When at last-but-one character and a text property
// follows after it, we may need to flush the line after
// displaying that character.
+ // Or when not wrapping and at the rightmost column.
text_prop_follows = TRUE;
}
#endif
#endif
) || lcs_eol_one == -1)
break;
+#ifdef FEAT_PROP_POPUP
+ if (!wp->w_p_wrap)
+ {
+ // do not output more of the line, only the "below" prop
+ ptr += STRLEN(ptr);
+# ifdef FEAT_LINEBREAK
+ dont_use_showbreak = TRUE;
+# endif
+ }
+#endif
// When the window is too narrow draw all "@" lines.
if (wlv.draw_state != WL_LINE
call delete('XscriptPropsAfterNowrap')
endfunc
+func Test_props_with_text_below_nowrap()
+ CheckRunVimInTerminal
+
+ let lines =<< trim END
+ vim9script
+ edit foobar
+ set nowrap
+ set showbreak=+++\
+ setline(1, ['onasdf asdf asdf sdf df asdf asdf e asdf asdf asdf asdf asd fas df', 'two'])
+ prop_type_add('test', {highlight: 'Special'})
+ prop_add(1, 0, {
+ type: 'test',
+ text: 'the quick brown fox jumps over the lazy dog',
+ text_align: 'after'
+ })
+ prop_add(1, 0, {
+ type: 'test',
+ text: 'the quick brown fox jumps over the lazy dog',
+ text_align: 'below'
+ })
+ normal G$
+ END
+ call writefile(lines, 'XscriptPropsBelowNowrap')
+ let buf = RunVimInTerminal('-S XscriptPropsBelowNowrap', #{rows: 8, cols: 60})
+ call VerifyScreenDump(buf, 'Test_prop_with_text_below_nowrap_1', {})
+
+ call term_sendkeys(buf, "gg$")
+ call VerifyScreenDump(buf, 'Test_prop_with_text_below_nowrap_2', {})
+
+ call StopVimInTerminal(buf)
+ call delete('XscriptPropsBelowNowrap')
+endfunc
+
func Test_props_with_text_after_split_join()
CheckRunVimInTerminal