diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-05-11 07:13:21 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-05-11 07:13:21 -0700 |
commit | 13fcac0589e72c9c9ed43ec09ae514d3895d6bb5 (patch) | |
tree | 0fd26afee86edf6aba8c3a176ac1549f7300a42d | |
parent | 4dc7fe9854ca533ea4de84221061fb857b6e0dd4 (diff) | |
download | pw-13fcac0589e72c9c9ed43ec09ae514d3895d6bb5.tar.gz pw-13fcac0589e72c9c9ed43ec09ae514d3895d6bb5.tar.bz2 pw-13fcac0589e72c9c9ed43ec09ae514d3895d6bb5.zip |
:p command resets any parameters not specified.
-rw-r--r-- | pw.1 | 3 | ||||
-rw-r--r-- | pw.c | 4 |
2 files changed, 5 insertions, 2 deletions
@@ -672,7 +672,8 @@ will have to occur again before the next automatic suspension. .IP "\fB:p\fP [\fIinteger\fP[,\fIinteger\fP[,\fIinteger\fP[,\fIinteger\fP[,\fIinteger\fP]]]]] Sets the display parameters, exactly in the manner of the .B -p -option. +option. Any parameters not specified are reset to their default initial values: +zero in the case of character positions, off in the case of flags. .IP "\fB:s\fP [\fIfilename\fP]" Save a snapshot of the configuration state to the specified file. @@ -683,6 +683,9 @@ static int decodeparms(pwstate *pw, char *parms, char *vs2pos = strtok(0, ", \t"); char *flags = strtok(0, ", \t"); + pw->hpos = pw->vsplit1 = pw->vsplit2 = pw->vs2pos = 0; + pw->stat &= ~stat_save; + if (hpos && (pw->hpos = getznn(hpos, &err)) < 0) { snprintf(resbuf, size, "bad horizontal scroll offset %s: %s\n", hpos, err); return 0; @@ -709,7 +712,6 @@ static int decodeparms(pwstate *pw, char *parms, snprintf(resbuf, size, "bad flags %s: %s\n", flags, err); return 0; } - pw->stat &= ~stat_save; pw->stat |= (stat & stat_save); } |