shithub: riscv

Download patch

ref: d67596f1bbdce63cd6a053cc17443fde1631ed10
parent: f664bc3ff0d111fedfa24f193dceed6d859427d8
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Mon Oct 17 19:00:49 EDT 2022

zuke: display currently enabled modes when stopped

--- a/sys/src/cmd/audio/zuke/zuke.c
+++ b/sys/src/cmd/audio/zuke/zuke.c
@@ -291,12 +291,13 @@
 		shuffle != nil ? "∫" : "",
 		(rg || repeatone || shuffle != nil) ? " " : ""
 	);
-	msec = dur = w = 0;
+	msec = dur = 0;
+	w = stringwidth(f, tmp);
 	if(pcurplaying >= 0){
 		msec = byteswritten*1000/Bps;
 		if((dur = getmeta(pcurplaying)->duration) > 0){
 			snprint(tmp+i, sizeof(tmp)-i, "%P/%P ", dur/1000, dur/1000);
-			w = stringwidth(f, tmp);
+			w += stringwidth(f, tmp+i);
 			msec = MIN(msec, dur);
 			i += snprint(tmp+i, sizeof(tmp)-i, "%P/%P ",
 				(uvlong)(newseekmx >= 0 ? seekoff : msec)/1000,
@@ -304,7 +305,7 @@
 			);
 		}else{
 			i += snprint(tmp+i, sizeof(tmp)-i, "%P ", msec/1000);
-			w = stringwidth(f, tmp);
+			w += stringwidth(f, tmp+i);
 		}
 	}
 	snprint(tmp+i, sizeof(tmp)-i, "%d%%", 100);