aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-03-14 11:32:34 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-04-26 19:17:16 -0400
commit05f58a285863913341107fd4d551cca3a1885227 (patch)
treedf4d63dd3eab45627d21db6d43255b7a09aff254
parent355dffdd769ffb12ad3e54528fb6910b08facb6c (diff)
downloadrneovim-05f58a285863913341107fd4d551cca3a1885227.tar.gz
rneovim-05f58a285863913341107fd4d551cca3a1885227.tar.bz2
rneovim-05f58a285863913341107fd4d551cca3a1885227.zip
vim-patch:8.0.1292: quick clicks in the WinBar start Visual mode
Problem: Quick clicks in the WinBar start Visual mode. Solution: Use a double click in the WinBar like a normal click. https://github.com/vim/vim/commit/d327b0c68fa9b32877123f77560f4521a9eb39db
-rw-r--r--src/nvim/mouse.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c
index da585ca1e7..fcd9ee4f75 100644
--- a/src/nvim/mouse.c
+++ b/src/nvim/mouse.c
@@ -94,10 +94,24 @@ int jump_to_mouse(int flags,
retnomove:
// before moving the cursor for a left click which is NOT in a status
// line, stop Visual mode
- if (on_status_line)
+ if (on_status_line) {
return IN_STATUS_LINE;
- if (on_sep_line)
+ }
+ if (on_sep_line) {
return IN_SEP_LINE;
+ }
+ if (in_winbar) {
+ // A quick second click may arrive as a double-click, but we use it
+ // as a second click in the WinBar.
+ if ((mod_mask & MOD_MASK_MULTI_CLICK) && !(flags & MOUSE_RELEASED)) {
+ wp = mouse_find_win(&grid, &row, &col);
+ if (wp == NULL) {
+ return IN_UNKNOWN;
+ }
+ winbar_click(wp, col);
+ }
+ return IN_OTHER_WIN | MOUSE_WINBAR;
+ }
if (flags & MOUSE_MAY_STOP_VIS) {
end_visual_mode();
redraw_curbuf_later(INVERTED); // delete the inversion