Commit 33a37c0a authored by Deucе's avatar Deucе 👌🏾
Browse files

Ok, that last one was wrong... sue me.

So here's what we're doing now... we set bar so that the first item
shown in the menu is the lowest index possible that still shows cur.
bar is therefore calculated as the displayed item count minus the
distance from cur to the end of the list.

Yeah, that's the easiest way to explain it.
parent e79fd123
Pipeline #1242 failed with stage
in 7 minutes and 27 seconds
......@@ -44,6 +44,7 @@ struct list_ctx_private {
int top;
int width;
};
struct showbuf_ctx_private {
int cur;
int bar;
......
......@@ -931,10 +931,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
(*cur)=(*bar);
i=(*cur)-(*bar);
if(i+(height-vbrdrsize-1)>=opts) {
i=opts-(height-vbrdrsize);
if(i<0)
i=0;
(*cur)=i+(*bar);
(*bar)=(height-vbrdrsize)-(opts-cur);
}
}
if((*cur)<0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment