aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-04-29 02:52:47 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-04-29 02:52:47 -0700
commit324c9bacb37b1c967e9d03a983147f5ded603ad3 (patch)
tree492d63d4605ba8bebdfcf81ff9856a1f9bf881a3
parentbcab803191a240e87414d58fdb6112e9299cb72e (diff)
downloadpw-324c9bacb37b1c967e9d03a983147f5ded603ad3.tar.gz
pw-324c9bacb37b1c967e9d03a983147f5ded603ad3.tar.bz2
pw-324c9bacb37b1c967e9d03a983147f5ded603ad3.zip
Bugfix: while editing new trigger, don't reset current.
-rw-r--r--pw.13
-rw-r--r--pw.c16
2 files changed, 12 insertions, 7 deletions
diff --git a/pw.1 b/pw.1
index 281ba17..542099e 100644
--- a/pw.1
+++ b/pw.1
@@ -216,6 +216,9 @@ recall using the up and down arrow keys or
.B Ctrl-P
and
.BR Ctrl-N .
+While the trigger pattern is being edited, the current trigger remains
+in effect. Editing a trigger pattern may be canceled with
+.BR ESC .
.IP \fB+\fP
Increases the display size by one line. This doesn't come into effect
diff --git a/pw.c b/pw.c
index 826f0eb..dd0160e 100644
--- a/pw.c
+++ b/pw.c
@@ -844,13 +844,6 @@ int main(int argc, char **argv)
}
break;
case kbd_trig:
- if (trigpat) {
- regfree(&trigex);
- dsdrop(trigpat);
- trigpat = 0;
- }
- stat &= ~(stat_htmode | stat_ttmode);
- // fallthrough
case kbd_colon:
switch (ch) {
case ESC:
@@ -875,6 +868,15 @@ int main(int argc, char **argv)
}
}
+ if (kbd_state == kbd_trig) {
+ if (trigpat) {
+ regfree(&trigex);
+ dsdrop(trigpat);
+ trigpat = 0;
+ }
+ stat &= ~(stat_htmode | stat_ttmode);
+ }
+
if (kbd_state == kbd_colon && cmdbuf[1]) {
execute(cmdbuf, &stat);
if (cmdbuf[0] != 0) {