aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-06-15 18:14:06 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-06-15 18:14:06 -0700
commit6c8630a7ff8af9f01fdeb79c99fa360d29b0c293 (patch)
tree42bd3e9d6861dfd902165dcbed8f9f07ab10f429
parent71bbfa562d0299f443381dce206dd5662ffea744 (diff)
downloadpw-6c8630a7ff8af9f01fdeb79c99fa360d29b0c293.tar.gz
pw-6c8630a7ff8af9f01fdeb79c99fa360d29b0c293.tar.bz2
pw-6c8630a7ff8af9f01fdeb79c99fa360d29b0c293.zip
Regression: command histories conflated.
-rw-r--r--pw-relnotes.54
-rw-r--r--pw.c11
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>
diff --git a/pw.c b/pw.c
index b675a4d..ff4b352 100644
--- a/pw.c
+++ b/pw.c
@@ -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) {