Virtual text problems:
- Virtual text aligned "above": Wrong indentation when using tabs (Issue
#12232)
-- truncated Virtual text below an empty line causes display error #12493
Errors when running tests with valgrind:
- test_gui.vim:
int head = 0;
(void)win_lbr_chartabsize(cts, &head, NULL);
vcol += cts->cts_cur_text_width + head;
- // when properties are above or below the empty line must also be
- // counted
- if (cts->cts_ptr == cts->cts_line && cts->cts_prop_lines > 0)
+ // When properties are above the empty line must also be counted. For
+ // a property below the width already includes filling up the line.
+ if (cts->cts_ptr == cts->cts_line && cts->cts_prop_lines > 0
+ && !cts->cts_has_below)
++vcol;
cts->cts_vcol = vcol > MAXCOL ? MAXCOL : (int)vcol;
}
#if defined(FEAT_PROP_POPUP)
cts->cts_cur_text_width = 0;
+ cts->cts_has_below = false;
cts->cts_first_char = 0;
#endif
# endif
if (tp->tp_col == MAXCOL && (tp->tp_flags
& (TP_FLAG_ALIGN_ABOVE | TP_FLAG_ALIGN_BELOW)))
+ {
// count extra line for property above/below
++cts->cts_prop_lines;
+ if (tp->tp_flags & TP_FLAG_ALIGN_BELOW)
+ cts->cts_has_below = true;
+ }
}
}
if (tp->tp_col != MAXCOL && tp->tp_col - 1 > col)
char cts_has_prop_with_text; // TRUE if a property inserts text
int cts_cur_text_width; // width of current inserted text
int cts_prop_lines; // nr of properties above or below
+ bool cts_has_below; // true if a text property below was
+ // counted, its width fills up the line
int cts_first_char; // width text props above the line
int cts_above_width; // width of text props above the line,
// kept for the whole line
call StopVimInTerminal(buf)
endfunc
+func Test_prop_with_text_below_empty_truncated()
+ " Use a fixed size, the virtual text must be wider than the text area.
+ call NewWindow(12, 40)
+ setlocal number
+ call setline(1, ['11111', '', '33333', '', '55555'])
+
+ call prop_type_add('belowprop', #{highlight: 'Directory'})
+ for ln in range(1, 5)
+ call prop_add(ln, 0, #{type: 'belowprop',
+ \ text: repeat('+', winwidth(0)), text_align: 'below'})
+ endfor
+ normal! G
+ redraw
+
+ " Every line takes two screen lines: the line and the virtual text below it.
+ call assert_equal(9, winline())
+
+ call prop_type_delete('belowprop')
+ bwipe!
+endfunc
+
func Test_prop_multiple_lines_above()
CheckScreendump
CheckRunVimInTerminal
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 901,
/**/
900,
/**/