forked from aniani/vim
patch 9.0.0067: cannot show virtual text
Problem: Cannot show virtual text. Solution: Initial changes for virtual text support, using text properties.
This commit is contained in:
19
src/misc2.c
19
src/misc2.c
@@ -128,7 +128,6 @@ coladvance2(
|
||||
{
|
||||
colnr_T wcol = wcol_arg;
|
||||
int idx;
|
||||
char_u *ptr;
|
||||
char_u *line;
|
||||
colnr_T col = 0;
|
||||
int csize = 0;
|
||||
@@ -158,6 +157,7 @@ coladvance2(
|
||||
else
|
||||
{
|
||||
int width = curwin->w_width - win_col_off(curwin);
|
||||
chartabsize_T cts;
|
||||
|
||||
if (finetune
|
||||
&& curwin->w_p_wrap
|
||||
@@ -180,19 +180,22 @@ coladvance2(
|
||||
}
|
||||
}
|
||||
|
||||
ptr = line;
|
||||
while (col <= wcol && *ptr != NUL)
|
||||
init_chartabsize_arg(&cts, curwin, pos->lnum, 0, line, line);
|
||||
while (cts.cts_vcol <= wcol && *cts.cts_ptr != NUL)
|
||||
{
|
||||
// Count a tab for what it's worth (if list mode not on)
|
||||
#ifdef FEAT_LINEBREAK
|
||||
csize = win_lbr_chartabsize(curwin, line, ptr, col, &head);
|
||||
MB_PTR_ADV(ptr);
|
||||
csize = win_lbr_chartabsize(&cts, &head);
|
||||
MB_PTR_ADV(cts.cts_ptr);
|
||||
#else
|
||||
csize = lbr_chartabsize_adv(line, &ptr, col);
|
||||
csize = lbr_chartabsize_adv(&cts);
|
||||
#endif
|
||||
col += csize;
|
||||
cts.cts_vcol += csize;
|
||||
}
|
||||
idx = (int)(ptr - line);
|
||||
col = cts.cts_vcol;
|
||||
idx = (int)(cts.cts_ptr - line);
|
||||
clear_chartabsize_arg(&cts);
|
||||
|
||||
/*
|
||||
* Handle all the special cases. The virtual_active() check
|
||||
* is needed to ensure that a virtual position off the end of
|
||||
|
Reference in New Issue
Block a user