shithub: fork

Download patch

ref: d9c7f0cfd403e58587e784db42d408ff193cbbf5
parent: 522979e76a67e0a0d5d677ef9ded8b43844497f4
author: qwx <qwx@sciops.net>
date: Mon Nov 10 06:24:33 EST 2025

jamterm: further tweaks from akw for scrollbar patch

--- a/sys/src/cmd/jamterm/io.c
+++ b/sys/src/cmd/jamterm/io.c
@@ -353,7 +353,7 @@
 		return c;
 	}
 	if(recv(kbdchan, &s) < 0){
-		fprint(2, "samterm: keybard recv error: %r\n");
+		fprint(2, "jamterm: keybard recv error: %r\n");
 		panic("kbd");
 	}
 	kbdkey(s);
--- a/sys/src/cmd/jamterm/samterm.h
+++ b/sys/src/cmd/jamterm/samterm.h
@@ -164,6 +164,7 @@
 void	flushtyping(int);
 void	dumperrmsg(int, int, int, int);
 int	screensize(int*,int*);
+void	flushdisplay(void);
 Rectangle inflatepoint(Point);
 int	promptrect(Rectangle*, Flayer*, int);
 Rectangle	defaultcmdrect(void);
--- a/sys/src/cmd/jamterm/scroll.c
+++ b/sys/src/cmd/jamterm/scroll.c
@@ -103,6 +103,7 @@
 		if(but == 2){
 			o = (tot / (s.max.y - s.min.y)) * my;
 			n = 0;
+			forcenter(l, o, n);
 		}else{
 			o = l->origin;
 			n = my/l->f.font->height;
@@ -110,17 +111,16 @@
 				n++;
 			if(but == 1 || but == 4)
 				n = -n;
+			forcenter(l, o, n);
 			if(!once){
-				if(but == 4 || but == 5){
-					center(l, o, n);
+				flushdisplay();
+				if(but == 4 || but == 5)
 					return;
-				}
 				once++;
 				sleep(175);
 			}
 			sleep(25);
 		}
-		forcenter(l, o, n);
 		if(nbrecv(mousectl->c, mousectl) < 0)
 			panic("mouse");
 	}while(mousectl->buttons & (1 << (but-1)));
--