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>
This commit is contained in:
Hirohito Higashi
2025-06-01 20:22:55 +02:00
committed by Christian Brabandt
parent 6c40df09e0
commit 3b9b95dc63
61 changed files with 649 additions and 374 deletions

View File

@ -164,7 +164,7 @@ draw_tabpanel(void)
int row = 0;
int off = 0;
#endif
int vsrow = 0;
int vsrow = 0;
int is_right = tpl_align == ALIGN_RIGHT;
if (maxwidth == 0)
@ -198,14 +198,10 @@ int vsrow = 0;
maxwidth - VERT_LEN, &curtab_row, NULL);
do_by_tplmode(TPLMODE_REDRAW, VERT_LEN, maxwidth, &curtab_row,
NULL);
// clear for multi-byte vert separater
screen_fill(0, cmdline_row, COLUMNS_WITHOUT_TPL(),
COLUMNS_WITHOUT_TPL() + VERT_LEN,
TPL_FILLCHAR, TPL_FILLCHAR, vs_attr);
// draw vert separater in tabpanel
// draw vert separator in tabpanel
for (vsrow = 0; vsrow < cmdline_row; vsrow++)
screen_putchar(curwin->w_fill_chars.tpl_vert, vsrow,
COLUMNS_WITHOUT_TPL(), vs_attr);
topframe->fr_width, vs_attr);
}
else
{
@ -214,10 +210,7 @@ int vsrow = 0;
&curtab_row, NULL);
do_by_tplmode(TPLMODE_REDRAW, 0, maxwidth - VERT_LEN,
&curtab_row, NULL);
// clear for multi-byte vert separater
screen_fill(0, cmdline_row, maxwidth - VERT_LEN,
maxwidth, TPL_FILLCHAR, TPL_FILLCHAR, vs_attr);
// draw vert separater in tabpanel
// draw vert separator in tabpanel
for (vsrow = 0; vsrow < cmdline_row; vsrow++)
screen_putchar(curwin->w_fill_chars.tpl_vert, vsrow,
maxwidth - VERT_LEN, vs_attr);
@ -272,8 +265,8 @@ screen_fill_tailing_area(
int is_right = tpl_align == ALIGN_RIGHT;
if (tplmode == TPLMODE_REDRAW)
screen_fill(row_start, row_end,
(is_right ? COLUMNS_WITHOUT_TPL() : 0) + col_start,
(is_right ? COLUMNS_WITHOUT_TPL() : 0) + col_end,
(is_right ? topframe->fr_width : 0) + col_start,
(is_right ? topframe->fr_width : 0) + col_end,
TPL_FILLCHAR, TPL_FILLCHAR, attr);
}
@ -356,7 +349,7 @@ screen_puts_len_for_tabpanel(
if (*pargs->pcol + chcells <= pargs->col_end)
{
int off = (tpl_align == ALIGN_RIGHT)
? COLUMNS_WITHOUT_TPL()
? topframe->fr_width
: 0;
if (TPLMODE_REDRAW == tplmode
&& (*pargs->prow - pargs->offsetrow >= 0
@ -628,7 +621,7 @@ do_by_tplmode(
p++;
}
while (p[i] != '\n' && p[i] != '\r' && (p[i] != NUL))
while (p[i] != '\n' && p[i] != '\r' && p[i] != NUL)
{
if (i + 1 >= sizeof(buf))
break;