aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-10-31 15:23:20 +0800
committerGitHub <noreply@github.com>2023-10-31 15:23:20 +0800
commitd4c2fc6ff6c579b2588f0e3ba02e5cbe58308c6a (patch)
tree7f40c5dac027802c2df10e26b0cd79d5d8da7bca /src
parentc881092ffe9d6760d08efcd4dfb02efcb60cc706 (diff)
downloadrneovim-d4c2fc6ff6c579b2588f0e3ba02e5cbe58308c6a.tar.gz
rneovim-d4c2fc6ff6c579b2588f0e3ba02e5cbe58308c6a.tar.bz2
rneovim-d4c2fc6ff6c579b2588f0e3ba02e5cbe58308c6a.zip
fix(terminal): keep focus when scrolling number column of another window (#25848)
Diffstat (limited to 'src')
-rw-r--r--src/nvim/terminal.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c
index fbfe8c04a6..a4ae8d2ae2 100644
--- a/src/nvim/terminal.c
+++ b/src/nvim/terminal.c
@@ -1417,13 +1417,14 @@ static void mouse_action(Terminal *term, int button, int row, int col, bool pres
static bool send_mouse_event(Terminal *term, int c)
{
int row = mouse_row, col = mouse_col, grid = mouse_grid;
- int offset;
win_T *mouse_win = mouse_find_win(&grid, &row, &col);
- if (mouse_win == NULL || (offset = win_col_off(mouse_win)) > col) {
+ if (mouse_win == NULL) {
goto end;
}
- if (term->forward_mouse && mouse_win->w_buffer->terminal == term) {
+ int offset;
+ if (term->forward_mouse && mouse_win->w_buffer->terminal == term
+ && col >= (offset = win_col_off(mouse_win))) {
// event in the terminal window and mouse events was enabled by the
// program. translate and forward the event
int button;