diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-06-15 18:14:06 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-06-15 18:14:06 -0700 |
commit | 6c8630a7ff8af9f01fdeb79c99fa360d29b0c293 (patch) | |
tree | 42bd3e9d6861dfd902165dcbed8f9f07ab10f429 | |
parent | 71bbfa562d0299f443381dce206dd5662ffea744 (diff) | |
download | pw-6c8630a7ff8af9f01fdeb79c99fa360d29b0c293.tar.gz pw-6c8630a7ff8af9f01fdeb79c99fa360d29b0c293.tar.bz2 pw-6c8630a7ff8af9f01fdeb79c99fa360d29b0c293.zip |
Regression: command histories conflated.
-rw-r--r-- | pw-relnotes.5 | 4 | ||||
-rw-r--r-- | pw.c | 11 |
2 files changed, 10 insertions, 5 deletions
diff --git a/pw-relnotes.5 b/pw-relnotes.5 index ff858c3..2ae8843 100644 --- a/pw-relnotes.5 +++ b/pw-relnotes.5 @@ -39,6 +39,10 @@ The original command for saving settings was renamed to .B :sa +.IP 2. +Bugfix: a regression was fixed causing colon commands not to have +a separate command history from trigger patterns. + .SH AUTHOR Kaz Kylheku <kaz@kylheku.com> @@ -1887,10 +1887,10 @@ int main(int argc, char **argv) if (ch == CR) { int count = (cmdcount == INT_MAX) ? 0 : cmdcount; if (pw.cmdbuf[1]) { - int *pnhist = (kbd_state == kbd_lcmd ? &ncmdhist : &npathist); + int iscolon = pw.cmdbuf[0] == ':'; + int *pnhist = (iscolon ? &ncmdhist : &npathist); int nhist = *pnhist; - char ***hist = (kbd_state == kbd_lcmd ? - &cmdhist : &pathist); + char ***hist = (iscolon ? &cmdhist : &pathist); if (nhist == 0 || strcmp(pw.cmdbuf, (*hist)[0]) != 0) { if ((*hist = resizebuf(*hist, nhist, nhist + 1)) == 0) @@ -1977,8 +1977,9 @@ int main(int argc, char **argv) case ctrl('p'): case ctrl('n'): { - int nhist = (kbd_state == kbd_lcmd ? ncmdhist : npathist); - char ***hist = (kbd_state == kbd_lcmd ? &cmdhist : &pathist); + int iscolon = pw.cmdbuf[0] == ':'; + int nhist = (iscolon ? ncmdhist : npathist); + char ***hist = (iscolon ? &cmdhist : &pathist); if (ch == ctrl('p')) { if (histpos == 0) { |