To: vim_dev@googlegroups.com Subject: Patch 8.1.1874 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.1874 Problem: Modeless selection in popup window overlaps scrollbar. Solution: Subtract scrollbar from max_col. (closes #4773) Files: src/ui.c, src/testdir/test_popupwin.vim, src/testdir/dumps/Test_popupwin_select_01.dump *** ../vim-8.1.1873/src/ui.c 2019-08-17 16:15:49.737383014 +0200 --- src/ui.c 2019-08-17 19:07:03.342055063 +0200 *************** *** 1098,1104 **** // 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) - wp->w_popup_border[1]; if (cb->max_col > screen_Columns) cb->max_col = screen_Columns; cb->min_row = wp->w_winrow + wp->w_popup_border[0]; --- 1098,1105 ---- // 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) ! - wp->w_popup_border[1] - wp->w_has_scrollbar; if (cb->max_col > screen_Columns) cb->max_col = screen_Columns; cb->min_row = wp->w_winrow + wp->w_popup_border[0]; *** ../vim-8.1.1873/src/testdir/test_popupwin.vim 2019-08-16 17:31:12.404409846 +0200 --- src/testdir/test_popupwin.vim 2019-08-17 19:04:41.186759981 +0200 *************** *** 506,516 **** let lines =<< trim END set clipboard=autoselect call setline(1, range(1, 20)) ! let winid = popup_create(['the word', 'some more', 'several words here'], #{ \ drag: 1, \ border: [], \ line: 3, \ col: 10, \ }) func Select1() call feedkeys("\\\\\", "xt") --- 506,517 ---- let lines =<< trim END set clipboard=autoselect call setline(1, range(1, 20)) ! let winid = popup_create(['the word', 'some more', 'several words here', 'invisible', '5', '6', '7'], #{ \ drag: 1, \ border: [], \ line: 3, \ col: 10, + \ maxheight: 3, \ }) func Select1() call feedkeys("\\\\\", "xt") *** ../vim-8.1.1873/src/testdir/dumps/Test_popupwin_select_01.dump 2019-06-14 23:41:30.443699903 +0200 --- src/testdir/dumps/Test_popupwin_select_01.dump 2019-08-17 19:07:26.869938700 +0200 *************** *** 1,10 **** >1+0&#ffffff0| @73 |2| @73 ! |3| @7|╔+0#0000001#ffd7ff255|═@17|╗| +0#0000000#ffffff0@45 ! |4| @7|║+0#0000001#ffd7ff255|t|h|e| |w+1#0000000#ffffff0|o|r|d| @9|║+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#0000001#ffd7ff255| +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#ffffff0@45 ! |7| @7|╚+0#0000001#ffd7ff255|═@17|╝| +0#0000000#ffffff0@45 |8| @73 |9| @73 |:|c|a|l@1| |S|e|l|e|c|t|1|(|)| @41|1|,|1| @10|T|o|p| --- 1,10 ---- >1+0&#ffffff0| @73 |2| @73 ! |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|║+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&#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#a8a8a8255|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@44 ! |7| @7|╚+0#0000001#ffd7ff255|═@18|╝| +0#0000000#ffffff0@44 |8| @73 |9| @73 |:|c|a|l@1| |S|e|l|e|c|t|1|(|)| @41|1|,|1| @10|T|o|p| *** ../vim-8.1.1873/src/version.c 2019-08-17 17:50:04.360627316 +0200 --- src/version.c 2019-08-17 19:09:15.773401120 +0200 *************** *** 771,772 **** --- 771,774 ---- { /* Add new patch number below this line */ + /**/ + 1874, /**/ -- If your nose runs, and your feet smell, you might be upside down. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///