summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-05-30 13:20:56 +0100
committerBram Moolenaar <Bram@vim.org>2022-05-30 13:20:56 +0100
commit89b25585ccecf223ca41ca212df8ebc227fc035a (patch)
treee571445a3cc8c0ec19e5d32cafc1d0943b1bd068
parent9e636b9d2ef54552383daebf290d916b3d001823 (diff)
downloadvim-git-89b25585ccecf223ca41ca212df8ebc227fc035a.tar.gz
patch 8.2.5042: scrollbar thumb in tall scrolled popup not visiblev8.2.5042
Problem: Scrollbar thumb in tall scrolled popup not visible. Solution: Show at least one thumb character. (fixes 10492)
-rw-r--r--src/popupwin.c2
-rw-r--r--src/testdir/dumps/Test_popupwin_scroll_13.dump14
-rw-r--r--src/testdir/test_popupwin.vim4
-rw-r--r--src/version.c2
4 files changed, 12 insertions, 10 deletions
diff --git a/src/popupwin.c b/src/popupwin.c
index a011b39ec..c9f4468b5 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -4108,7 +4108,7 @@ update_popups(void (*win_update)(win_T *wp))
last = total_height - top_off - wp->w_popup_border[2];
if (sb_thumb_top >= last)
// show at least one character
- sb_thumb_top = last;
+ sb_thumb_top = last - 1;
if (wp->w_scrollbar_highlight != NULL)
attr_scroll = syn_name2attr(wp->w_scrollbar_highlight);
diff --git a/src/testdir/dumps/Test_popupwin_scroll_13.dump b/src/testdir/dumps/Test_popupwin_scroll_13.dump
index c168da26f..067f484d4 100644
--- a/src/testdir/dumps/Test_popupwin_scroll_13.dump
+++ b/src/testdir/dumps/Test_popupwin_scroll_13.dump
@@ -1,10 +1,10 @@
->1+0&#ffffff0| @73
-|2| @73
-|3| @73
-|4| @20|1+0#0000001#ffd7ff255|9| @27| +0#0000000#a8a8a8255| +0&#ffffff0@21
+>1+0&#ffffff0| @20|9+0#0000001#ffd7ff255@1| @27| +0#0000000#a8a8a8255| +0&#ffffff0@21
+|2| @20| +0#4040ff13#ffd7ff255@29| +0#0000000#a8a8a8255| +0&#ffffff0@21
+|3| @20| +0#4040ff13#ffd7ff255@29| +0#0000000#a8a8a8255| +0&#ffffff0@21
+|4| @20| +0#4040ff13#ffd7ff255@29| +0#0000000#a8a8a8255| +0&#ffffff0@21
|5| @20| +0#4040ff13#ffd7ff255@29| +0#0000000#a8a8a8255| +0&#ffffff0@21
|6| @20| +0#4040ff13#ffd7ff255@29| +0#0000000#a8a8a8255| +0&#ffffff0@21
-|7| @20| +0#4040ff13#ffd7ff255@29| +0#0000000#0000001| +0&#ffffff0@21
-|8| @73
-|9| @73
+|7| @20| +0#4040ff13#ffd7ff255@29| +0#0000000#a8a8a8255| +0&#ffffff0@21
+|8| @20| +0#4040ff13#ffd7ff255@29| +0#0000000#a8a8a8255| +0&#ffffff0@21
+|9| @20| +0#4040ff13#ffd7ff255@29| +0#0000000#0000001| +0&#ffffff0@21
|:|c|a|l@1| |S|c|r|o|l@1|B|o|t@1|o|m|(|)| @36|1|,|1| @10|T|o|p|
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 7fc5ef573..950edf2ad 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -2344,8 +2344,8 @@ func Test_popup_scrollbar()
endfunc
func ScrollBottom()
call popup_clear()
- let id = CreatePopup(range(20)->map({k, v -> string(v)}))
- call popup_setoptions(id, #{firstline: 20})
+ let id = CreatePopup(range(100)->map({k, v -> string(v)}))
+ call popup_setoptions(id, #{firstline: 100, minheight: 9, maxheight: 9})
endfunc
map <silent> <F3> :call test_setmouse(5, 36)<CR>
map <silent> <F4> :call test_setmouse(4, 42)<CR>
diff --git a/src/version.c b/src/version.c
index cbe6ff4d6..18a1fdb41 100644
--- a/src/version.c
+++ b/src/version.c
@@ -735,6 +735,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 5042,
+/**/
5041,
/**/
5040,