patch 8.2.5040: scrollbar thumb in scrolled popup not visible
Problem: Scrollbar thumb in scrolled popup not visible.
Solution: Show at least one thumb character. (fixes 10492)
diff --git a/src/popupwin.c b/src/popupwin.c
index 5074eaa..a011b39 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -4087,6 +4087,7 @@
{
linenr_T linecount = wp->w_buffer->b_ml.ml_line_count;
int height = wp->w_height;
+ int last;
sb_thumb_height = ((linenr_T)height * height + linecount / 2)
/ linecount;
@@ -4104,6 +4105,10 @@
/ (linecount - wp->w_height);
if (wp->w_topline > 1 && sb_thumb_top == 0 && height > 1)
sb_thumb_top = 1; // show it's scrolled
+ last = total_height - top_off - wp->w_popup_border[2];
+ if (sb_thumb_top >= last)
+ // show at least one character
+ sb_thumb_top = last;
if (wp->w_scrollbar_highlight != NULL)
attr_scroll = syn_name2attr(wp->w_scrollbar_highlight);