mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.1.1874: modeless selection in popup window overlaps scrollbar
Problem: Modeless selection in popup window overlaps scrollbar. Solution: Subtract scrollbar from max_col. (closes #4773)
This commit is contained in:
parent
df70775555
commit
4dd751b956
@ -1,10 +1,10 @@
|
|||||||
>1+0&#ffffff0| @73
|
>1+0&#ffffff0| @73
|
||||||
|2| @73
|
|2| @73
|
||||||
|3| @7|╔+0#0000001#ffd7ff255|═@17|╗| +0#0000000#ffffff0@45
|
|3| @7|╔+0#0000001#ffd7ff255|═@18|╗| +0#0000000#ffffff0@44
|
||||||
|4| @7|║+0#0000001#ffd7ff255|t|h|e| |w+1#0000000#ffffff0|o|r|d| @9|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@45
|
|4| @7|║+0#0000001#ffd7ff255|t|h|e| |w+1#0000000#ffffff0|o|r|d| @9| +0|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@44
|
||||||
|5| @7|║+0#0000001#ffd7ff255|s+1#0000000#ffffff0|o|m|e| |m|o|r|e| @8|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@45
|
|5| @7|║+0#0000001#ffd7ff255|s+1#0000000#ffffff0|o|m|e| |m|o|r|e| @8| +0&#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@44
|
||||||
|6| @7|║+0#0000001#ffd7ff255|s+1#0000000#ffffff0|e|v|e|r|a|l| |w|o|r|d|s| +0#0000001#ffd7ff255|h|e|r|e|║| +0#0000000#ffffff0@45
|
|6| @7|║+0#0000001#ffd7ff255|s+1#0000000#ffffff0|e|v|e|r|a|l| |w|o|r|d|s| +0#0000001#ffd7ff255|h|e|r|e| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@44
|
||||||
|7| @7|╚+0#0000001#ffd7ff255|═@17|╝| +0#0000000#ffffff0@45
|
|7| @7|╚+0#0000001#ffd7ff255|═@18|╝| +0#0000000#ffffff0@44
|
||||||
|8| @73
|
|8| @73
|
||||||
|9| @73
|
|9| @73
|
||||||
|:|c|a|l@1| |S|e|l|e|c|t|1|(|)| @41|1|,|1| @10|T|o|p|
|
|:|c|a|l@1| |S|e|l|e|c|t|1|(|)| @41|1|,|1| @10|T|o|p|
|
||||||
|
@ -506,11 +506,12 @@ func Test_popup_select()
|
|||||||
let lines =<< trim END
|
let lines =<< trim END
|
||||||
set clipboard=autoselect
|
set clipboard=autoselect
|
||||||
call setline(1, range(1, 20))
|
call setline(1, range(1, 20))
|
||||||
let winid = popup_create(['the word', 'some more', 'several words here'], #{
|
let winid = popup_create(['the word', 'some more', 'several words here', 'invisible', '5', '6', '7'], #{
|
||||||
\ drag: 1,
|
\ drag: 1,
|
||||||
\ border: [],
|
\ border: [],
|
||||||
\ line: 3,
|
\ line: 3,
|
||||||
\ col: 10,
|
\ col: 10,
|
||||||
|
\ maxheight: 3,
|
||||||
\ })
|
\ })
|
||||||
func Select1()
|
func Select1()
|
||||||
call feedkeys("\<F3>\<LeftMouse>\<F4>\<LeftDrag>\<LeftRelease>", "xt")
|
call feedkeys("\<F3>\<LeftMouse>\<F4>\<LeftDrag>\<LeftRelease>", "xt")
|
||||||
|
3
src/ui.c
3
src/ui.c
@ -1098,7 +1098,8 @@ clip_start_selection(int col, int row, int repeated_click)
|
|||||||
// Click in a popup window restricts selection to that window,
|
// Click in a popup window restricts selection to that window,
|
||||||
// excluding the border.
|
// excluding the border.
|
||||||
cb->min_col = wp->w_wincol + wp->w_popup_border[3];
|
cb->min_col = wp->w_wincol + wp->w_popup_border[3];
|
||||||
cb->max_col = wp->w_wincol + popup_width(wp) - wp->w_popup_border[1];
|
cb->max_col = wp->w_wincol + popup_width(wp)
|
||||||
|
- wp->w_popup_border[1] - wp->w_has_scrollbar;
|
||||||
if (cb->max_col > screen_Columns)
|
if (cb->max_col > screen_Columns)
|
||||||
cb->max_col = screen_Columns;
|
cb->max_col = screen_Columns;
|
||||||
cb->min_row = wp->w_winrow + wp->w_popup_border[0];
|
cb->min_row = wp->w_winrow + wp->w_popup_border[0];
|
||||||
|
@ -769,6 +769,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1874,
|
||||||
/**/
|
/**/
|
||||||
1873,
|
1873,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user