To: vim_dev@googlegroups.com Subject: Patch 8.1.2032 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2032 Problem: Scrollbar thumb wrong in popup window. Solution: Adjust thumb size and position when scrolled. Files: src/popupwin.c, src/testdir/dumps/Test_popupwin_scroll_2.dump *** ../vim-8.1.2031/src/popupwin.c 2019-09-08 17:11:39.350869449 +0200 --- src/popupwin.c 2019-09-14 22:19:58.202535629 +0200 *************** *** 3363,3372 **** // Compute scrollbar thumb position and size. if (wp->w_has_scrollbar) { ! linenr_T linecount = wp->w_buffer->b_ml.ml_line_count; ! sb_thumb_height = (wp->w_height * wp->w_height + linecount / 2) ! / linecount; if (sb_thumb_height == 0) sb_thumb_height = 1; if (linecount <= wp->w_height) --- 3363,3374 ---- // Compute scrollbar thumb position and size. if (wp->w_has_scrollbar) { ! linenr_T linecount = wp->w_buffer->b_ml.ml_line_count; ! int height = wp->w_height; ! sb_thumb_height = (height * height + linecount / 2) / linecount; ! if (wp->w_topline > 1 && sb_thumb_height == height) ! --sb_thumb_height; // scrolled, no full thumb if (sb_thumb_height == 0) sb_thumb_height = 1; if (linecount <= wp->w_height) *************** *** 3377,3382 **** --- 3379,3387 ---- + (linecount / wp->w_height) / 2) * (wp->w_height - sb_thumb_height) / (linecount - wp->w_height); + if (wp->w_topline > 1 && sb_thumb_top == 0 && height > 1) + sb_thumb_top = 1; // show it's scrolled + if (wp->w_scrollbar_highlight != NULL) attr_scroll = syn_name2attr(wp->w_scrollbar_highlight); else *** ../vim-8.1.2031/src/testdir/dumps/Test_popupwin_scroll_2.dump 2019-07-14 18:22:53.793088979 +0200 --- src/testdir/dumps/Test_popupwin_scroll_2.dump 2019-09-14 22:16:27.066974932 +0200 *************** *** 1,9 **** >1+0&#ffffff0| @73 |2| @73 |3| @73 ! |4| @31|t+0#0000001#ffd7ff255|w|o| @4| +0#0000000#0000001| +0&#ffffff0@32 |5| @31|t+0#0000001#ffd7ff255|h|r|e@1| @2| +0#0000000#0000001| +0&#ffffff0@32 ! |6| @31|f+0#0000001#ffd7ff255|o|u|r| @3| +0#0000000#a8a8a8255| +0&#ffffff0@32 |7| @31|f+0#0000001#ffd7ff255|i|v|e| @3| +0#0000000#a8a8a8255| +0&#ffffff0@32 |8| @73 |9| @73 --- 1,9 ---- >1+0&#ffffff0| @73 |2| @73 |3| @73 ! |4| @31|t+0#0000001#ffd7ff255|w|o| @4| +0#0000000#a8a8a8255| +0&#ffffff0@32 |5| @31|t+0#0000001#ffd7ff255|h|r|e@1| @2| +0#0000000#0000001| +0&#ffffff0@32 ! |6| @31|f+0#0000001#ffd7ff255|o|u|r| @3| +0#0000000#0000001| +0&#ffffff0@32 |7| @31|f+0#0000001#ffd7ff255|i|v|e| @3| +0#0000000#a8a8a8255| +0&#ffffff0@32 |8| @73 |9| @73 *** ../vim-8.1.2031/src/version.c 2019-09-14 21:55:29.854096832 +0200 --- src/version.c 2019-09-14 22:21:55.322245687 +0200 *************** *** 759,760 **** --- 759,762 ---- { /* Add new patch number below this line */ + /**/ + 2032, /**/ -- hundred-and-one symptoms of being an internet addict: 259. When you enter your name in the AltaVista search engine, the top ten matches do indeed refer to you. /// 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 ///