summaryrefslogtreecommitdiffstats
path: root/src/getchar.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-07-25 18:13:54 +0100
committerBram Moolenaar <Bram@vim.org>2022-07-25 18:13:54 +0100
commit7f9969c559b51446632ac7e8f76cde07e7d0078d (patch)
tree77868549433487dbadb8833a1b6a63d522adaa72 /src/getchar.c
parentb529cfbd04c02e31cfa88f2c8d88b5ff532d4f7d (diff)
patch 9.0.0067: cannot show virtual textv9.0.0067
Problem: Cannot show virtual text. Solution: Initial changes for virtual text support, using text properties.
Diffstat (limited to 'src/getchar.c')
-rw-r--r--src/getchar.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/getchar.c b/src/getchar.c
index fc15daaf7d..a3de6509f5 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -3210,7 +3210,7 @@ vgetorpeek(int advance)
&& (c = inchar(typebuf.tb_buf + typebuf.tb_off
+ typebuf.tb_len, 3, 25L)) == 0)
{
- colnr_T col = 0, vcol;
+ colnr_T col = 0;
char_u *ptr;
if (mode_displayed)
@@ -3242,24 +3242,30 @@ vgetorpeek(int advance)
{
if (did_ai)
{
+ chartabsize_T cts;
+
/*
* We are expecting to truncate the trailing
* white-space, so find the last non-white
* character -- webb
*/
- col = vcol = curwin->w_wcol = 0;
+ curwin->w_wcol = 0;
ptr = ml_get_curline();
- while (col < curwin->w_cursor.col)
+ init_chartabsize_arg(&cts, curwin,
+ curwin->w_cursor.lnum, 0, ptr, ptr);
+ while (cts.cts_ptr < ptr + curwin->w_cursor.col)
{
- if (!VIM_ISWHITE(ptr[col]))
- curwin->w_wcol = vcol;
- vcol += lbr_chartabsize(ptr, ptr + col,
- vcol);
+ if (!VIM_ISWHITE(*cts.cts_ptr))
+ curwin->w_wcol = cts.cts_vcol;
+ cts.cts_vcol += lbr_chartabsize(&cts);
if (has_mbyte)
- col += (*mb_ptr2len)(ptr + col);
+ cts.cts_ptr +=
+ (*mb_ptr2len)(cts.cts_ptr);
else
- ++col;
+ ++cts.cts_ptr;
}
+ clear_chartabsize_arg(&cts);
+
curwin->w_wrow = curwin->w_cline_row
+ curwin->w_wcol / curwin->w_width;
curwin->w_wcol %= curwin->w_width;