shithub: pplay

Download patch

ref: 972c000fd317b151248c2ca73c3a40666e2eb955
parent: 78081938a68eb8fa075ca13456970ae8d65eba19
author: qwx <qwx@sciops.net>
date: Thu Nov 17 08:35:24 EST 2022

fix paste command

--- a/cmd.c
+++ b/cmd.c
@@ -274,9 +274,9 @@
 	Chunk *c, *l, *dotc;
 
 	c = clonechunk();
-	if(dot.from.pos == dot.to.pos){		/* insert */
-		linkchunk(p2c(dot.to.pos, nil), c);
-		setrange(dot.to.pos, dot.to.pos + c->bufsz);
+	if(dot.from.pos == 0 && dot.to.pos == totalsz){		/* insert */
+		linkchunk(p2c(dot.pos, nil), c);
+		setrange(dot.pos, dot.pos + c->bufsz);
 		totalsz += c->bufsz;
 	}else{						/* replace */
 		dotc = p2c(dot.pos, nil);