patch 9.1.1403: expansion of 'tabpanelopt' value adds wrong values

Problem:  expansion of 'tabpanelopt' value adds wrong values
          (Shane-XB-Qian, after v9.1.1391)
Solution: update tabpanelopt expansion function and expand only valid
          values (Hirohito Higashi)

related: #17263
closes: #17359

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-05-22 22:41:05 +02:00
committed by Christian Brabandt
parent 5b07aff2f6
commit 598bbb1941
4 changed files with 42 additions and 12 deletions

View File

@ -64,15 +64,21 @@ tabpanelopt_changed(void)
p = p_tplo;
while (*p != NUL)
{
if (STRNCMP(p, "align:left", 10) == 0)
if (STRNCMP(p, "align:", 6) == 0)
{
p += 10;
new_align = ALIGN_LEFT;
}
else if (STRNCMP(p, "align:right", 11) == 0)
{
p += 11;
new_align = ALIGN_RIGHT;
p += 6;
if (STRNCMP(p, "left", 4) == 0)
{
p += 4;
new_align = ALIGN_LEFT;
}
else if (STRNCMP(p, "right", 5) == 0)
{
p += 5;
new_align = ALIGN_RIGHT;
}
else
return FAIL;
}
else if (STRNCMP(p, "columns:", 8) == 0 && VIM_ISDIGIT(p[8]))
{