diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-04-29 02:52:47 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-04-29 02:52:47 -0700 |
commit | 324c9bacb37b1c967e9d03a983147f5ded603ad3 (patch) | |
tree | 492d63d4605ba8bebdfcf81ff9856a1f9bf881a3 | |
parent | bcab803191a240e87414d58fdb6112e9299cb72e (diff) | |
download | pw-324c9bacb37b1c967e9d03a983147f5ded603ad3.tar.gz pw-324c9bacb37b1c967e9d03a983147f5ded603ad3.tar.bz2 pw-324c9bacb37b1c967e9d03a983147f5ded603ad3.zip |
Bugfix: while editing new trigger, don't reset current.
-rw-r--r-- | pw.1 | 3 | ||||
-rw-r--r-- | pw.c | 16 |
2 files changed, 12 insertions, 7 deletions
@@ -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 @@ -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) { |