aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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) {