summaryrefslogtreecommitdiff
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-07-21 19:25:18 +0200
committerBram Moolenaar <Bram@vim.org>2020-07-21 19:25:18 +0200
commitf56c95fdad5af521887f8cd7bc15729b5355231d (patch)
treea6e5d9c1387b041f82705056777ce9c86e5fd6cc /src/buffer.c
parent08815a1d0350fbcc007aea5dd1272454c03fab4f (diff)
downloadvim-git-f56c95fdad5af521887f8cd7bc15729b5355231d.tar.gz
patch 8.2.1259: empty group in 'tabline' may cause using an invalid pointerv8.2.1259
Problem: Empty group in 'tabline' may cause using an invalid pointer. Solution: Set the group start position. (closes #6505)
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 40ca25dfa..54afb13b0 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -4229,12 +4229,19 @@ build_stl_str_hl(
}
if (n == curitem && group_start_userhl == group_end_userhl)
{
+ // empty group
p = t;
l = 0;
- // do not use the highlighting from the removed group
for (n = groupitem[groupdepth] + 1; n < curitem; n++)
+ {
+ // do not use the highlighting from the removed group
if (item[n].type == Highlight)
item[n].type = Empty;
+ // adjust the start position of TabPage to the next
+ // item position
+ if (item[n].type == TabPage)
+ item[n].start = p;
+ }
}
}
if (l > item[groupitem[groupdepth]].maxwid)