diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-05-19 19:11:11 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-05-19 19:16:31 +0800 |
commit | 0997884ae24fee68819217c1528523a5b72c1788 (patch) | |
tree | 2c9229b5379bce2492a9d059127033ee5bcd082c /src | |
parent | d200ba654a31e1387df5ef5e91c067182cc405d7 (diff) | |
download | rneovim-0997884ae24fee68819217c1528523a5b72c1788.tar.gz rneovim-0997884ae24fee68819217c1528523a5b72c1788.tar.bz2 rneovim-0997884ae24fee68819217c1528523a5b72c1788.zip |
fix(mouse): fix mouse drag position with winbar
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/mouse.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c index fe21279ef7..862899e78b 100644 --- a/src/nvim/mouse.c +++ b/src/nvim/mouse.c @@ -159,16 +159,16 @@ retnomove: fdc = win_fdccol_count(wp); dragwin = NULL; - if (row == -1 + wp->w_winbar_height) { - on_winbar = !!wp->w_winbar_height; + if (row == -1) { + on_winbar = wp->w_winbar_height != 0; return IN_OTHER_WIN | (on_winbar ? MOUSE_WINBAR : 0); } on_winbar = false; // winpos and height may change in win_enter()! - if (grid == DEFAULT_GRID_HANDLE && row >= wp->w_height) { + if (grid == DEFAULT_GRID_HANDLE && row + wp->w_winbar_height >= wp->w_height) { // In (or below) status line - on_status_line = row - wp->w_height + 1; + on_status_line = row + wp->w_winbar_height - wp->w_height + 1; dragwin = wp; } else { on_status_line = 0; @@ -406,9 +406,6 @@ bool mouse_comp_pos(win_T *win, int *rowp, int *colp, linenr_T *lnump) if (win->w_p_rl) { col = win->w_width_inner - 1 - col; } - if (win->w_winbar_height) { - row -= win->w_winbar_height; - } lnum = win->w_topline; @@ -509,7 +506,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_winrow_off - wp->w_winbar_height; + *rowp -= wp->w_winbar_height; return wp; } } |