diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-07-24 18:16:53 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-24 18:16:53 +0800 |
commit | 5fb4c397a1da2737262ac7686666dc2596db50c2 (patch) | |
tree | 3cedc049a223c8f8135f16a00ddc1679dd1dddf7 /src | |
parent | 01e273c340b5e51b593900c8feb894ba9a46c366 (diff) | |
download | rneovim-5fb4c397a1da2737262ac7686666dc2596db50c2.tar.gz rneovim-5fb4c397a1da2737262ac7686666dc2596db50c2.tar.bz2 rneovim-5fb4c397a1da2737262ac7686666dc2596db50c2.zip |
fix(mouse): drag vsep of window with 'statuscolumn' (#24462)
Problem: Cannot drag a vertical separator to the right of a window
whose 'statuscolumn' is wider than itself.
Solution: Never treat a click on a vertical separator as a click on
'statuscolumn'.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/mouse.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c index aca15eb0e2..d8341d2b10 100644 --- a/src/nvim/mouse.c +++ b/src/nvim/mouse.c @@ -1107,21 +1107,11 @@ retnomove: } bool below_window = grid == DEFAULT_GRID_HANDLE && row + wp->w_winbar_height >= wp->w_height; - on_status_line = (below_window) - ? row + wp->w_winbar_height - wp->w_height + 1 == 1 - : false; - - on_winbar = (row == -1) - ? wp->w_winbar_height != 0 - : false; - - on_statuscol = !below_window && !on_status_line && !on_winbar && col < win_col_off(wp) - ? *wp->w_p_stc != NUL - : false; - - on_sep_line = grid == DEFAULT_GRID_HANDLE && col >= wp->w_width - ? col - wp->w_width + 1 == 1 - : false; + on_status_line = below_window && row + wp->w_winbar_height - wp->w_height + 1 == 1; + on_sep_line = grid == DEFAULT_GRID_HANDLE && col >= wp->w_width && col - wp->w_width + 1 == 1; + on_winbar = row == -1 && wp->w_winbar_height != 0; + on_statuscol = !below_window && !on_status_line && !on_sep_line && !on_winbar + && *wp->w_p_stc != NUL && col < win_col_off(wp); // The rightmost character of the status line might be a vertical // separator character if there is no connecting window to the right. |