aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mouse.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-03-13 22:05:05 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-04-26 19:17:16 -0400
commit64b61d49c2c3350833ca490c9fdf8540298cd01a (patch)
treeaf2b4047fd193d5fb9748a374775099b6a1f6e5d /src/nvim/mouse.c
parent5f41717838f4cd9d1087e452640ba554500279ab (diff)
downloadrneovim-64b61d49c2c3350833ca490c9fdf8540298cd01a.tar.gz
rneovim-64b61d49c2c3350833ca490c9fdf8540298cd01a.tar.bz2
rneovim-64b61d49c2c3350833ca490c9fdf8540298cd01a.zip
vim-patch:8.0.1123: cannot define a toolbar for a window
Problem: Cannot define a toolbar for a window. Solution: Add a window-local toolbar. https://github.com/vim/vim/commit/1b9645de3c05f37b5c30e78f999351b0cf486ade "WinBar" code in "screen.c" was not ported. Fix https://github.com/neovim/neovim/issues/11513#issuecomment-562012827
Diffstat (limited to 'src/nvim/mouse.c')
-rw-r--r--src/nvim/mouse.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c
index 32d8352d9b..88a9cb2d5e 100644
--- a/src/nvim/mouse.c
+++ b/src/nvim/mouse.c
@@ -134,6 +134,14 @@ retnomove:
}
fdc = win_fdccol_count(wp);
dragwin = NULL;
+
+ if (row == -1) {
+ // A click in the window toolbar does not enter another window or
+ // change Visual highlighting.
+ winbar_click(wp, col);
+ return IN_OTHER_WIN;
+ }
+
// winpos and height may change in win_enter()!
if (grid == DEFAULT_GRID_HANDLE && row >= wp->w_height) {
// In (or below) status line
@@ -471,6 +479,7 @@ win_T *mouse_find_win(int *gridp, int *rowp, int *colp)
// exist.
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
if (wp == fp->fr_win) {
+ *rowp -= wp->w_winbar_height;
return wp;
}
}