patch 9.1.1425: tabpanel: there are still some problems with the tabpanel
Problem: tabpanel: there are still some problems with the tabpanel with
column handling
Solution: fix the problems and refactor Tabpanel feature (Hirohito
Higashi).
fixes: #17423
fixes: #17332
closes: #17336
Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/popupmenu.c b/src/popupmenu.c
index 6d91c33..fb32017 100644
--- a/src/popupmenu.c
+++ b/src/popupmenu.c
@@ -658,25 +658,22 @@
width = cells + over_cell + 1;
rt = orig_rt;
- screen_putchar(truncrl, row,
- col - width + 1 + TPL_LCOL(NULL), trunc_attr);
+ screen_putchar(truncrl, row, col - width + 1, trunc_attr);
if (over_cell > 0)
- screen_fill(row, row + 1, col - width + 2 + TPL_LCOL(NULL),
- col - width + 2 + over_cell + TPL_LCOL(NULL), ' ', ' ',
- attr);
+ screen_fill(row, row + 1, col - width + 2,
+ col - width + 2 + over_cell, ' ', ' ', attr);
}
if (attrs == NULL)
- screen_puts_len(rt, (int)STRLEN(rt), row,
- col - cells + 1 + TPL_LCOL(NULL), attr);
+ screen_puts_len(rt, (int)STRLEN(rt), row, col - cells + 1, attr);
else
- pum_screen_puts_with_attrs(row, col - cells + 1 + TPL_LCOL(NULL),
- cells, rt, (int)STRLEN(rt), attrs);
+ pum_screen_puts_with_attrs(row, col - cells + 1, cells, rt,
+ (int)STRLEN(rt), attrs);
vim_free(rt_start);
VIM_CLEAR(st);
- return col - width + TPL_LCOL(NULL);
+ return col - width;
}
#endif
@@ -750,19 +747,17 @@
}
if (attrs == NULL)
- screen_puts_len(st, size, row, col + TPL_LCOL(NULL), attr);
+ screen_puts_len(st, size, row, col, attr);
else
- pum_screen_puts_with_attrs(row, col + TPL_LCOL(NULL), cells, st, size,
- attrs);
+ pum_screen_puts_with_attrs(row, col, cells, st, size, attrs);
if (truncated)
{
if (over_cell > 0)
- screen_fill(row, row + 1, col + cells + TPL_LCOL(NULL),
- col + cells + over_cell + TPL_LCOL(NULL), ' ', ' ', attr);
+ screen_fill(row, row + 1, col + cells,
+ col + cells + over_cell, ' ', ' ', attr);
- screen_putchar(trunc, row,
- col + cells + over_cell + TPL_LCOL(NULL), trunc_attr);
+ screen_putchar(trunc, row, col + cells + over_cell, trunc_attr);
}
VIM_CLEAR(st);
@@ -873,10 +868,10 @@
#ifdef FEAT_RIGHTLEFT
if (pum_rl)
- screen_putchar(' ', row, pum_col - pum_width + TPL_LCOL(NULL), attr);
+ screen_putchar(' ', row, pum_col - pum_width, attr);
else
#endif
- screen_putchar(' ', row, pum_col + pum_width + TPL_LCOL(NULL), attr);
+ screen_putchar(' ', row, pum_col + pum_width, attr);
}
/*
@@ -959,12 +954,12 @@
if (pum_rl)
{
if (pum_col < curwin->w_wincol + curwin->w_width - 1)
- screen_putchar(' ', row, pum_col + 1 + TPL_LCOL(NULL), attr);
+ screen_putchar(' ', row, pum_col + 1, attr);
}
else
#endif
if (pum_col > 0)
- screen_putchar(' ', row, pum_col - 1 + TPL_LCOL(NULL), attr);
+ screen_putchar(' ', row, pum_col - 1, attr);
// Display each entry, use two spaces for a Tab.
// Do this 3 times and order from p_cia
@@ -1005,16 +1000,15 @@
#ifdef FEAT_RIGHTLEFT
if (pum_rl)
{
- screen_fill(row, row + 1, pum_col - basic_width - n + 1 + TPL_LCOL(NULL),
- col + 1 + TPL_LCOL(NULL), ' ', ' ', orig_attr);
+ screen_fill(row, row + 1, pum_col - basic_width - n + 1,
+ col + 1, ' ', ' ', orig_attr);
col = pum_col - basic_width - n;
}
else
#endif
{
- screen_fill(row, row + 1, col + TPL_LCOL(NULL),
- pum_col + basic_width + n + TPL_LCOL(NULL), ' ', ' ',
- orig_attr);
+ screen_fill(row, row + 1, col, pum_col + basic_width + n,
+ ' ', ' ', orig_attr);
col = pum_col + basic_width + n;
}
totwidth = basic_width + n;
@@ -1022,14 +1016,12 @@
#ifdef FEAT_RIGHTLEFT
if (pum_rl)
- screen_fill(row, row + 1,
- pum_col - pum_width + 1 + TPL_LCOL(NULL),
- col + 1 + TPL_LCOL(NULL), ' ', ' ', orig_attr);
+ screen_fill(row, row + 1, pum_col - pum_width + 1, col + 1, ' ',
+ ' ', orig_attr);
else
#endif
- screen_fill(row, row + 1, col + TPL_LCOL(NULL),
- pum_col + pum_width + TPL_LCOL(NULL),
- ' ', ' ', orig_attr);
+ screen_fill(row, row + 1, col, pum_col + pum_width, ' ', ' ',
+ orig_attr);
pum_draw_scrollbar(row, i, thumb_pos, thumb_height);
++row;