From 102971a396724594a00f7e31cbeec55cdb536f17 Mon Sep 17 00:00:00 2001 From: luukvbaal Date: Wed, 19 Jun 2024 00:00:39 +0200 Subject: fix(mouse): early return when clicking in padded 'statuscolumn' (#29394) Problem: Hit assert when clicking inside a padded 'statuscolumn' that is padded beyond the length of the allocated click_defs. Solution: Still consider this a "in_statuscol" click, but return early when about to execute the click func. --- src/nvim/mouse.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c index f393b0fd0f..bd245bdca3 100644 --- a/src/nvim/mouse.c +++ b/src/nvim/mouse.c @@ -688,6 +688,9 @@ popupexit: if (in_statuscol && wp->w_p_rl) { click_col = wp->w_width_inner - click_col - 1; } + if (in_statuscol && click_col >= (int)wp->w_statuscol_click_defs_size) { + return false; + } if (click_defs != NULL) { switch (click_defs[click_col].type) { -- cgit