aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorluukvbaal <luukvbaal@gmail.com>2024-06-19 00:00:39 +0200
committerGitHub <noreply@github.com>2024-06-19 06:00:39 +0800
commit102971a396724594a00f7e31cbeec55cdb536f17 (patch)
tree7cef292406260647b06e8ef6f34211b8802b1c67 /src
parent2791fd4e1722fd45fa0f4261879046e8d397645a (diff)
downloadrneovim-102971a396724594a00f7e31cbeec55cdb536f17.tar.gz
rneovim-102971a396724594a00f7e31cbeec55cdb536f17.tar.bz2
rneovim-102971a396724594a00f7e31cbeec55cdb536f17.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/mouse.c3
1 files changed, 3 insertions, 0 deletions
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) {