aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShirasaka <tk.shirasaka@gmail.com>2020-11-07 23:47:27 +0900
committerShirasaka <tk.shirasaka@gmail.com>2020-11-09 02:12:39 +0900
commit368403a9e60ba3695717fa224b8fa249d8e6425b (patch)
tree85343c2c48636926d7d34b220fe7be5bbfee74b2 /src
parent5caaacaafeecb71b7526a182f434945be588a827 (diff)
downloadrneovim-368403a9e60ba3695717fa224b8fa249d8e6425b.tar.gz
rneovim-368403a9e60ba3695717fa224b8fa249d8e6425b.tar.bz2
rneovim-368403a9e60ba3695717fa224b8fa249d8e6425b.zip
ui: Fix click on foldcolumn when ext_multigrid is enabled
Diffstat (limited to 'src')
-rw-r--r--src/nvim/mouse.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c
index 748001dcec..03cd438e2c 100644
--- a/src/nvim/mouse.c
+++ b/src/nvim/mouse.c
@@ -75,6 +75,7 @@ int jump_to_mouse(int flags,
int grid = mouse_grid;
int mouse_char;
int fdc = 0;
+ ScreenGrid *gp = &default_grid;
mouse_past_bottom = false;
mouse_past_eol = false;
@@ -125,16 +126,6 @@ retnomove:
if (flags & MOUSE_SETPOS)
goto retnomove; // ugly goto...
- // Remember the character under the mouse, might be one of foldclose or
- // foldopen fillchars in the fold column.
- if (row >= 0 && row < Rows && col >= 0 && col <= Columns
- && default_grid.chars != NULL) {
- mouse_char = utf_ptr2char(default_grid.chars[default_grid.line_offset[row]
- + (unsigned)col]);
- } else {
- mouse_char = ' ';
- }
-
old_curwin = curwin;
old_cursor = curwin->w_cursor;
@@ -333,6 +324,19 @@ retnomove:
}
}
+ // Remember the character under the mouse, might be one of foldclose or
+ // foldopen fillchars in the fold column.
+ if (ui_has(kUIMultigrid)) {
+ gp = &curwin->w_grid;
+ }
+ if (row >= 0 && row < Rows && col >= 0 && col <= Columns
+ && gp->chars != NULL) {
+ mouse_char = utf_ptr2char(gp->chars[gp->line_offset[row]
+ + (unsigned)col]);
+ } else {
+ mouse_char = ' ';
+ }
+
// Check for position outside of the fold column.
if (curwin->w_p_rl ? col < curwin->w_width_inner - fdc :
col >= fdc + (cmdwin_type == 0 ? 0 : 1)) {