summaryrefslogtreecommitdiffstats
path: root/src/drawline.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/drawline.c')
-rw-r--r--src/drawline.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/src/drawline.c b/src/drawline.c
index 8ec9e5f280..81577be42a 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -2073,29 +2073,34 @@ win_line(
--bcol;
# endif
// Add any text property that starts in this column.
- while (text_prop_next < text_prop_count
- && (text_props[text_prop_next].tp_col == MAXCOL
- ? (*ptr == NUL
- || (bcol == 0
- && (text_props[text_prop_next].tp_flags
- & TP_FLAG_ALIGN_ABOVE)))
- : bcol >= text_props[text_prop_next].tp_col - 1))
+ while (text_prop_next < text_prop_count)
{
- // With 'nowrap' and not in the first screen line only "below"
- // text prop can show.
- if (text_props[text_prop_next].tp_col == MAXCOL
- ? (wp->w_p_wrap
+ int active;
+ textprop_T *tp = &text_props[text_prop_next];
+ if (tp->tp_col == MAXCOL)
+ {
+ if (bcol == 0 && (tp->tp_flags & TP_FLAG_ALIGN_ABOVE))
+ active = TRUE;
+ else if (*ptr != NUL)
+ break;
+ else
+ {
+ // With 'nowrap' and not in the first screen line only "below"
+ // text prop can show.
+ active = wp->w_p_wrap
|| wlv.row == startrow
- || (text_props[text_prop_next].tp_flags
- & TP_FLAG_ALIGN_BELOW)
- || (bcol == 0
- && (text_props[text_prop_next].tp_flags
- & TP_FLAG_ALIGN_ABOVE)))
- : bcol <= text_props[text_prop_next].tp_col - 1
- + text_props[text_prop_next].tp_len)
+ || (tp->tp_flags & TP_FLAG_ALIGN_BELOW);
+ }
+ }
+ else
{
- text_prop_idxs[text_props_active++] = text_prop_next;
+ if (bcol < tp->tp_col - 1)
+ break;
+ active = bcol <= tp->tp_col - 1 + tp->tp_len;
}
+
+ if (active)
+ text_prop_idxs[text_props_active++] = text_prop_next;
++text_prop_next;
}