diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-09-23 15:08:17 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-09-23 15:08:17 +0200 |
commit | eb163d73b11c10b461a2839530173a33d7915a33 (patch) | |
tree | 581dae7631cb4d5e1f4d1aea5a071f39034a018d /src/ui.c | |
parent | e745d75c3e0d976e73bd17c395e9cce98f671692 (diff) | |
download | vim-git-eb163d73b11c10b461a2839530173a33d7915a33.tar.gz |
patch 8.0.1138: click in window toolbar starts Visual modev8.0.1138
Problem: Click in window toolbar starts Visual mode.
Solution: Add the MOUSE_WINBAR flag.
Diffstat (limited to 'src/ui.c')
-rw-r--r-- | src/ui.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -2611,6 +2611,9 @@ jump_to_mouse( { static int on_status_line = 0; /* #lines below bottom of window */ static int on_sep_line = 0; /* on separator right of window */ +#ifdef FEAT_MENU + static int in_winbar = FALSE; +#endif static int prev_row = -1; static int prev_col = -1; static win_T *dragwin = NULL; /* window being dragged */ @@ -2699,8 +2702,10 @@ retnomove: /* A click in the window toolbar does not enter another window or * change Visual highlighting. */ winbar_click(wp, col); - return IN_OTHER_WIN; + in_winbar = TRUE; + return IN_OTHER_WIN | MOUSE_WINBAR; } + in_winbar = FALSE; #endif /* @@ -2829,6 +2834,13 @@ retnomove: } return IN_SEP_LINE; /* Cursor didn't move */ } +#ifdef FEAT_MENU + else if (in_winbar) + { + /* After a click on the window toolbar don't start Visual mode. */ + return IN_OTHER_WIN | MOUSE_WINBAR; + } +#endif else /* keep_window_focus must be TRUE */ { /* before moving the cursor for a left click, stop Visual mode */ |