more '&m'
For what a key does, when operating on 'm' which produces two lines of output, append a command to the first line so that the combination forms a complete sentence. Also, expand on the explanattion of what is going on in dowhatdoes().
This commit is contained in:
+13
-4
@@ -2149,6 +2149,8 @@ dowhatdoes_core(char q, char *cbuf)
|
|||||||
if ((ec_desc = key2extcmddesc(q)) != NULL) {
|
if ((ec_desc = key2extcmddesc(q)) != NULL) {
|
||||||
char keybuf[QBUFSZ];
|
char keybuf[QBUFSZ];
|
||||||
|
|
||||||
|
/* note: if "%-8s" gets changed, the "%8.8s" in dowhatdoes() will
|
||||||
|
need a comparable change */
|
||||||
Sprintf(buf, "%-8s%s.", key2txt(q, keybuf), ec_desc);
|
Sprintf(buf, "%-8s%s.", key2txt(q, keybuf), ec_desc);
|
||||||
Strcpy(cbuf, buf);
|
Strcpy(cbuf, buf);
|
||||||
return cbuf;
|
return cbuf;
|
||||||
@@ -2253,12 +2255,19 @@ dowhatdoes(void)
|
|||||||
|
|
||||||
if (q == '&' || q == '?')
|
if (q == '&' || q == '?')
|
||||||
whatdoes_help();
|
whatdoes_help();
|
||||||
if (p)
|
if (!p) {
|
||||||
*p = '\0';
|
/* normal usage; 'reslt' starts with key, some indentation, and
|
||||||
pline("%s", reslt);
|
then explanation followed by '.' for sentence punctuation */
|
||||||
if (p)
|
pline("%s", reslt);
|
||||||
|
} else {
|
||||||
|
/* for 'm' prefix, where 'reslt' has an embedded newline to
|
||||||
|
indicate and separate two lines of output; we add a comma to
|
||||||
|
first line so that the combination is a complete sentence */
|
||||||
|
*p = '\0'; /* replace embedded newline with end of first line */
|
||||||
|
pline("%s,", reslt);
|
||||||
/* cheat by knowing how dowhatdoes_core() handles key portion */
|
/* cheat by knowing how dowhatdoes_core() handles key portion */
|
||||||
pline("%8.8s%s", reslt, p + 1);
|
pline("%8.8s%s", reslt, p + 1);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
pline("No such command '%s', char code %d (0%03o or 0x%02x).",
|
pline("No such command '%s', char code %d (0%03o or 0x%02x).",
|
||||||
visctrl(q), (uchar) q, (uchar) q, (uchar) q);
|
visctrl(q), (uchar) q, (uchar) q, (uchar) q);
|
||||||
|
|||||||
Reference in New Issue
Block a user