commit a7b7c5d16b8d07b22f32c697b7f5b310f4bb5129
parent ff9b34311722c494cdd88ef7b5b0b44765d570a5
Author: Claudio Alessi <smoppy@gmail.com>
Date: Wed, 24 Aug 2022 00:24:51 +0200
Fix privmsg by clearing the command line at the end.
It's too late to keep playing around with this code. I made it works for now
but a little refactoring is needed.
Diffstat:
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/circo.c b/circo.c
@@ -624,11 +624,12 @@ cmdln_submit(const Arg *arg) {
logw("\n");
histpush(sel->cmdbuf, sel->cmdlen);
- sel->cmdlen = sel->cmdoff = sel->histlnoff = 0;
- sel->cmdbuf[sel->cmdlen] = '\0';
- sel->need_redraw |= REDRAW_CMDLN;
if(buf[0] == '/') {
+ sel->cmdlen = sel->cmdoff = sel->histlnoff = 0;
+ sel->cmdbuf[sel->cmdlen] = '\0';
+ sel->need_redraw |= REDRAW_CMDLN;
+
/* Note: network latency may cause visual glitches. */
parsecmd(buf);
}
@@ -639,6 +640,10 @@ cmdln_submit(const Arg *arg) {
bprintf(sel, "Not connected.\n");
else
privmsg(sel->name, sel->cmdbuf);
+
+ sel->cmdlen = sel->cmdoff = sel->histlnoff = 0;
+ sel->cmdbuf[sel->cmdlen] = '\0';
+ sel->need_redraw |= REDRAW_CMDLN;
}
free(buf);
}