comparison src/ui.c @ 12519:f62696bd1a9f v8.0.1138

patch 8.0.1138: click in window toolbar starts Visual mode commit https://github.com/vim/vim/commit/eb163d73b11c10b461a2839530173a33d7915a33 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 23 15:08:17 2017 +0200 patch 8.0.1138: click in window toolbar starts Visual mode Problem: Click in window toolbar starts Visual mode. Solution: Add the MOUSE_WINBAR flag.
author Christian Brabandt <cb@256bit.org>
date Sat, 23 Sep 2017 15:15:04 +0200
parents 972ea22c946f
children 351cf7c67bbe
comparison
equal deleted inserted replaced
12518:92ae7825fe2f 12519:f62696bd1a9f
2609 int *inclusive, /* used for inclusive operator, can be NULL */ 2609 int *inclusive, /* used for inclusive operator, can be NULL */
2610 int which_button) /* MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE */ 2610 int which_button) /* MOUSE_LEFT, MOUSE_RIGHT, MOUSE_MIDDLE */
2611 { 2611 {
2612 static int on_status_line = 0; /* #lines below bottom of window */ 2612 static int on_status_line = 0; /* #lines below bottom of window */
2613 static int on_sep_line = 0; /* on separator right of window */ 2613 static int on_sep_line = 0; /* on separator right of window */
2614 #ifdef FEAT_MENU
2615 static int in_winbar = FALSE;
2616 #endif
2614 static int prev_row = -1; 2617 static int prev_row = -1;
2615 static int prev_col = -1; 2618 static int prev_col = -1;
2616 static win_T *dragwin = NULL; /* window being dragged */ 2619 static win_T *dragwin = NULL; /* window being dragged */
2617 static int did_drag = FALSE; /* drag was noticed */ 2620 static int did_drag = FALSE; /* drag was noticed */
2618 2621
2697 if (row == -1) 2700 if (row == -1)
2698 { 2701 {
2699 /* A click in the window toolbar does not enter another window or 2702 /* A click in the window toolbar does not enter another window or
2700 * change Visual highlighting. */ 2703 * change Visual highlighting. */
2701 winbar_click(wp, col); 2704 winbar_click(wp, col);
2702 return IN_OTHER_WIN; 2705 in_winbar = TRUE;
2703 } 2706 return IN_OTHER_WIN | MOUSE_WINBAR;
2707 }
2708 in_winbar = FALSE;
2704 #endif 2709 #endif
2705 2710
2706 /* 2711 /*
2707 * winpos and height may change in win_enter()! 2712 * winpos and height may change in win_enter()!
2708 */ 2713 */
2827 win_drag_vsep_line(dragwin, count); 2832 win_drag_vsep_line(dragwin, count);
2828 did_drag |= count; 2833 did_drag |= count;
2829 } 2834 }
2830 return IN_SEP_LINE; /* Cursor didn't move */ 2835 return IN_SEP_LINE; /* Cursor didn't move */
2831 } 2836 }
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
2832 else /* keep_window_focus must be TRUE */ 2844 else /* keep_window_focus must be TRUE */
2833 { 2845 {
2834 /* before moving the cursor for a left click, stop Visual mode */ 2846 /* before moving the cursor for a left click, stop Visual mode */
2835 if (flags & MOUSE_MAY_STOP_VIS) 2847 if (flags & MOUSE_MAY_STOP_VIS)
2836 { 2848 {