summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2022-01-19 19:46:05 +0100
committerHiltjo Posthuma <hiltjo@codemadness.org>2022-01-19 19:46:05 +0100
commitfe0c6fa283bb7e3a04d95c00be76ff9b613e1cbf (patch)
tree20d4a687e37d180cc1704ae9fca05a20b181815a
parent1742c5e687cf6974c1c9c46e045291f879a79e27 (diff)
sfeed_curses: line editor: add more clear comments of signal handling
-rw-r--r--sfeed_curses.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sfeed_curses.c b/sfeed_curses.c
index 6adbfec..e048bcd 100644
--- 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 */