shithub: picker

Download patch

ref: e16aafb5603edde57dc889578c9706df9a427574
parent: 659fc7d347af59eccc12b5113a6a098c90915cb7
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Thu Jan 28 05:44:21 EST 2021

fix Kdel not working when there are no colors

--- a/picker.c
+++ b/picker.c
@@ -400,7 +400,7 @@
 		free(s);
 
 		if (n != 0) {
-			fprint(2, "%d: %r\n", i);
+			fprint(2, "readcolors: line %d: %r\n", i);
 			continue;
 		}
 
@@ -560,6 +560,8 @@
 			goto end;
 
 		case Ckey:
+			if (r == Kdel)
+				goto end;
 			if (c == nil)
 				break;
 			switch (r) {
@@ -573,8 +575,6 @@
 					color = c->next;
 				redraw();
 				break;
-			case Kdel:
-				goto end;
 			}
 			break;