commit fe0c6fa283bb7e3a04d95c00be76ff9b613e1cbf
parent 1742c5e687cf6974c1c9c46e045291f879a79e27
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Wed, 19 Jan 2022 19:46:05 +0100
sfeed_curses: line editor: add more clear comments of signal handling
Diffstat:
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/sfeed_curses.c b/sfeed_curses.c
@@ -1000,11 +1000,15 @@ lineeditor(void)
 			switch (sigstate) {
 			case 0:
 			case SIGWINCH:
-				continue; /* process signals later */
+				/* continue editing: process signal later */
+				continue;
 			case SIGINT:
-				sigstate = 0; /* exit prompt, do not quit */
-			case SIGTERM:
-				break; /* exit prompt and quit */
+				/* cancel prompt, but do not quit */
+				sigstate = 0; /* reset: do not handle it */
+				break;
+			default: /* other: SIGHUP, SIGTERM */
+				/* cancel prompt and handle signal after */
+				break;
 			}
 			free(input);
 			return NULL;
@@ -1664,7 +1668,7 @@ mousereport(int button, int release, int keymask, int x, int y)
 		selpane = i;
 		/* relative position on screen */
 		pos = y - p->y + p->pos - (p->pos % p->height);
-		dblclick = (pos == p->pos); /* clicking the same row twice */
+		dblclick = (pos == p->pos); /* clicking the already selected row */
 
 		switch (button) {
 		case 0: /* left-click */