neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 20bd4d89977005845c070cde9df75496f948fa1e
parent a600e73007a2cc9ced7eeaeb5f8c05ac454d080e
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Tue,  1 Nov 2022 10:21:15 +0800

vim-patch:9.0.0823: mouse drag test fails

Problem:    Mouse drag test fails.
Solution:   Only reset the mouse click flag when actually switching to another
            tab page.  Disable test that keeps failing.

https://github.com/vim/vim/commit/7a7db047dcb2336de5103e793345eb5a9d125900

Omit test_termcodes.vim change: reverted in patch 9.0.0825.

Co-authored-by: Bram Moolenaar <Bram@vim.org>

Diffstat:
Msrc/nvim/window.c | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/nvim/window.c b/src/nvim/window.c @@ -4195,7 +4195,6 @@ static int leave_tabpage(buf_T *new_curbuf, bool trigger_leave_autocmds) { tabpage_T *tp = curtab; - reset_mouse_got_click(); leaving_window(curwin); reset_VIsual_and_resel(); // stop Visual mode if (trigger_leave_autocmds) { @@ -4214,6 +4213,8 @@ static int leave_tabpage(buf_T *new_curbuf, bool trigger_leave_autocmds) return FAIL; } } + + reset_mouse_got_click(); tp->tp_curwin = curwin; tp->tp_prevwin = prevwin; tp->tp_firstwin = firstwin; @@ -4276,6 +4277,10 @@ static void enter_tabpage(tabpage_T *tp, buf_T *old_curbuf, bool trigger_enter_a clear_cmdline = true; } + // If there was a click in a window, it won't be usable for a following + // drag. + reset_mouse_got_click(); + // The tabpage line may have appeared or disappeared, may need to resize the frames for that. // When the Vim window was resized or ROWS_AVAIL changed need to update frame sizes too. if (curtab->tp_old_Rows_avail != ROWS_AVAIL || (old_off != firstwin->w_winrow)) { @@ -4393,7 +4398,6 @@ void goto_tabpage_tp(tabpage_T *tp, bool trigger_enter_autocmds, bool trigger_le // Don't repeat a message in another tab page. set_keep_msg(NULL, 0); - reset_mouse_got_click(); skip_win_fix_scroll = true; if (tp != curtab && leave_tabpage(tp->tp_curwin->w_buffer, trigger_leave_autocmds) == OK) {