1
0
forked from aniani/vim

patch 8.1.1786: double click in popup scrollbar starts selection

Problem:    Double click in popup scrollbar starts selection.
Solution:   Ignore the double click.
This commit is contained in:
Bram Moolenaar
2019-08-01 15:52:45 +02:00
parent b66bab381c
commit 13b11eddca
4 changed files with 44 additions and 28 deletions

View File

@@ -1058,6 +1058,17 @@ clip_compare_pos(
clip_start_selection(int col, int row, int repeated_click)
{
Clipboard_T *cb = &clip_star;
#ifdef FEAT_TEXT_PROP
win_T *wp;
int row_cp = row;
int col_cp = col;
wp = mouse_find_win(&row_cp, &col_cp, FIND_POPUP);
if (wp != NULL && WIN_IS_POPUP(wp)
&& popup_is_in_scrollbar(wp, row_cp, col_cp))
// click or double click in scrollbar does not start a selection
return;
#endif
if (cb->state == SELECT_DONE)
clip_clear_selection(cb);
@@ -1072,30 +1083,23 @@ clip_start_selection(int col, int row, int repeated_click)
cb->origin_row = (short_u)cb->start.lnum;
cb->state = SELECT_IN_PROGRESS;
#ifdef FEAT_TEXT_PROP
if (wp != NULL && WIN_IS_POPUP(wp))
{
win_T *wp;
int row_cp = row;
int col_cp = col;
wp = mouse_find_win(&row_cp, &col_cp, FIND_POPUP);
if (wp != NULL && WIN_IS_POPUP(wp))
{
// Click in a popup window restricts selection to that window,
// excluding the border.
cb->min_col = wp->w_wincol + wp->w_popup_border[3];
cb->max_col = wp->w_wincol + popup_width(wp) - 1
- wp->w_popup_border[1];
cb->min_row = wp->w_winrow + wp->w_popup_border[0];
cb->max_row = wp->w_winrow + popup_height(wp) - 1
- wp->w_popup_border[2];
}
else
{
cb->min_col = 0;
cb->max_col = screen_Columns;
cb->min_row = 0;
cb->max_row = screen_Rows;
}
// Click in a popup window restricts selection to that window,
// excluding the border.
cb->min_col = wp->w_wincol + wp->w_popup_border[3];
cb->max_col = wp->w_wincol + popup_width(wp) - 1
- wp->w_popup_border[1];
cb->min_row = wp->w_winrow + wp->w_popup_border[0];
cb->max_row = wp->w_winrow + popup_height(wp) - 1
- wp->w_popup_border[2];
}
else
{
cb->min_col = 0;
cb->max_col = screen_Columns;
cb->min_row = 0;
cb->max_row = screen_Rows;
}
#endif