File tree Expand file tree Collapse file tree 4 files changed +22
-1
lines changed
Expand file tree Collapse file tree 4 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -2794,6 +2794,12 @@ do_mouse(
27942794 */
27952795 jump_flags = jump_to_mouse (jump_flags ,
27962796 oap == NULL ? NULL : & (oap -> inclusive ), which_button );
2797+
2798+ #ifdef FEAT_MENU
2799+ /* A click in the window toolbar has no side effects. */
2800+ if (jump_flags & MOUSE_WINBAR )
2801+ return FALSE;
2802+ #endif
27972803 moved = (jump_flags & CURSOR_MOVED );
27982804 in_status_line = (jump_flags & IN_STATUS_LINE );
27992805 in_sep_line = (jump_flags & IN_SEP_LINE );
Original file line number Diff line number Diff line change @@ -2611,6 +2611,9 @@ jump_to_mouse(
26112611{
26122612 static int on_status_line = 0 ; /* #lines below bottom of window */
26132613 static int on_sep_line = 0 ; /* on separator right of window */
2614+ #ifdef FEAT_MENU
2615+ static int in_winbar = FALSE;
2616+ #endif
26142617 static int prev_row = -1 ;
26152618 static int prev_col = -1 ;
26162619 static win_T * dragwin = NULL ; /* window being dragged */
@@ -2699,8 +2702,10 @@ jump_to_mouse(
26992702 /* A click in the window toolbar does not enter another window or
27002703 * change Visual highlighting. */
27012704 winbar_click (wp , col );
2702- return IN_OTHER_WIN ;
2705+ in_winbar = TRUE;
2706+ return IN_OTHER_WIN | MOUSE_WINBAR ;
27032707 }
2708+ in_winbar = FALSE;
27042709#endif
27052710
27062711 /*
@@ -2829,6 +2834,13 @@ jump_to_mouse(
28292834 }
28302835 return IN_SEP_LINE ; /* Cursor didn't move */
28312836 }
2837+ #ifdef FEAT_MENU
2838+ else if (in_winbar )
2839+ {
2840+ /* After a click on the window toolbar don't start Visual mode. */
2841+ return IN_OTHER_WIN | MOUSE_WINBAR ;
2842+ }
2843+ #endif
28322844 else /* keep_window_focus must be TRUE */
28332845 {
28342846 /* before moving the cursor for a left click, stop Visual mode */
Original file line number Diff line number Diff line change @@ -761,6 +761,8 @@ static char *(features[]) =
761761
762762static int included_patches [] =
763763{ /* Add new patch number below this line */
764+ /**/
765+ 1138 ,
764766/**/
765767 1137 ,
766768/**/
Original file line number Diff line number Diff line change @@ -1898,6 +1898,7 @@ typedef int sock_T;
18981898# define CURSOR_MOVED 0x100
18991899# define MOUSE_FOLD_CLOSE 0x200 /* clicked on '-' in fold column */
19001900# define MOUSE_FOLD_OPEN 0x400 /* clicked on '+' in fold column */
1901+ # define MOUSE_WINBAR 0x800 /* in window toolbar */
19011902
19021903/* flags for jump_to_mouse() */
19031904# define MOUSE_FOCUS 0x01 /* need to stay in this window */
You can’t perform that action at this time.
0 commit comments