diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-11-01 10:21:15 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-11-02 08:06:23 +0800 |
commit | 20bd4d89977005845c070cde9df75496f948fa1e (patch) | |
tree | e5b35cad9611ece9004e0789d99b5c886b011f79 /src | |
parent | a600e73007a2cc9ced7eeaeb5f8c05ac454d080e (diff) | |
download | rneovim-20bd4d89977005845c070cde9df75496f948fa1e.tar.gz rneovim-20bd4d89977005845c070cde9df75496f948fa1e.tar.bz2 rneovim-20bd4d89977005845c070cde9df75496f948fa1e.zip |
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 (limited to 'src')
-rw-r--r-- | src/nvim/window.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c index 8c34e4fb6c..c1ed2b7920 100644 --- 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) { |