shithub: pplay

Download patch

ref: bd41f4a0c55c41d968807fdf9c91b71925b831fa
parent: 951fd81dd334fa33718bf7699cf1c6faed289c48
author: qwx <qwx@sciops.net>
date: Fri Jan 6 17:51:43 EST 2023

add Kleft and Kright fast panning by screenful

--- a/draw.c
+++ b/draw.c
@@ -278,6 +278,12 @@
 }
 
 void
+setpage(int d)
+{
+	setpan(d * (vlong)T * Dx(screen->r) / Dx(view->r));
+}
+
+void
 setloop(vlong off)
 {
 	off *= T;
--- a/fns.h
+++ b/fns.h
@@ -19,6 +19,7 @@
 void	setzoom(int, int);
 int	zoominto(vlong, vlong);
 void	setpan(int);
+void	setpage(int);
 void	setloop(vlong);
 void	setofs(usize);
 void	setjump(usize);
--- a/pplay.c
+++ b/pplay.c
@@ -153,6 +153,8 @@
 			case '=': setzoom(1, 0); break;
 			case '_': setzoom(-1, 1); break;
 			case '+': setzoom(1, 1); break;
+			case Kleft: setpage(-1); break;
+			case Kright: setpage(1); break;
 			default:
 				if(treadsoftly){
 					fprint(2, "dropping edit event during ongoing read\n");