diff options
author | Matthieu Coudron <mattator@gmail.com> | 2020-11-10 00:54:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-10 00:54:54 +0100 |
commit | e786fb5afbd7c4f07a18d73c282c8c5586b5f5f9 (patch) | |
tree | aee6f12e1de94356cef0dd37f79dcb5cef9522f1 /src | |
parent | 42ffa2d62ee714a165d56f5fa8022a32c7534d71 (diff) | |
parent | 5e7626a5c6af6fcdee809d54201929b6f78b72f6 (diff) | |
download | rneovim-e786fb5afbd7c4f07a18d73c282c8c5586b5f5f9.tar.gz rneovim-e786fb5afbd7c4f07a18d73c282c8c5586b5f5f9.tar.bz2 rneovim-e786fb5afbd7c4f07a18d73c282c8c5586b5f5f9.zip |
Merge pull request #13244 from tk-shirasaka/fix/multigrid-click-foldcolumn
ui: Fix click on foldcolumn when ext_multigrid is enabled
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/mouse.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c index 748001dcec..cff88de00b 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)) { |