commit 36dae15accbf25c4d011cf12a83a9888e4b6bd06
parent d2a427e7b73d10bb6b6e46c005b4180498570427
Author: hhvn <dev@hhvn.uk>
Date: Sun, 24 Apr 2022 10:03:49 +0100
Print regopt with SELF_IGNORE_LIST and SELF_IGNORE_ADDED
Diffstat:
2 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/src/commands.c b/src/commands.c
@@ -1567,6 +1567,17 @@ command_close) {
}
}
+static char *
+strregopt(int regopt) {
+ if (regopt & REG_EXTENDED && regopt & REG_ICASE)
+ return "extended+icase";
+ if (regopt & REG_EXTENDED)
+ return "extended";
+ if (regopt & REG_ICASE)
+ return "basic+icase";
+ return "basic";
+}
+
COMMAND(
command_ignore) {
struct Ignore *ign, *p;
@@ -1592,8 +1603,11 @@ command_ignore) {
hist_format(selected.history, Activity_none, HIST_UI, "SELF_IGNORES_START :Ignoring:");
for (p = ignores, i = 1; p; p = p->next, i++)
if (!serv || !p->server || strcmp(server->name, p->server) == 0)
- hist_format(selected.history, Activity_none, HIST_UI|HIST_NIGN, "SELF_IGNORES_LIST %d %s %s %s :%s",
- i, p->server ? p->server : "ANY", p->noact ? "yes" : "no", p->format ? p->format : "ANY", p->text);
+ hist_format(selected.history, Activity_none, HIST_UI|HIST_NIGN, "SELF_IGNORES_LIST %d %s %s %s %s :%s",
+ i, p->server ? p->server : "ANY",
+ p->noact ? "yes" : "no",
+ p->format ? p->format : "ANY",
+ strregopt(p->regopt), p->text);
hist_format(selected.history, Activity_none, HIST_UI, "SELF_IGNORES_END :End of ignore list");
return;
}
@@ -1691,8 +1705,12 @@ idrange:
ign->server = serv ? strdup(server->name) : NULL;
if (!nouich)
- hist_format(selected.history, Activity_none, HIST_UI, "SELF_IGNORES_ADDED %s %s %s :%s",
- serv ? server->name : "ANY", noact ? "yes" : "no", format ? format : "ANY", str);
+ hist_format(selected.history, Activity_none, HIST_UI|HIST_NIGN,
+ "SELF_IGNORES_ADDED %s %s %s %s :%s",
+ serv ? server->name : "ANY",
+ noact ? "yes" : "no",
+ format ? format : "ANY",
+ strregopt(regopt), str);
if (!ignores) {
ignores = ign;
diff --git a/src/data/config.h b/src/data/config.h
@@ -331,7 +331,7 @@ struct Config config[] = {
.description = {
"Format of ignore list header.", NULL}},
{"format.ui.ignores", 1, Val_string,
- .str = " %{pad:-3,${1}} (server: ${2}, noact: ${3}, format: ${4}) ${5}",
+ .str = " %{pad:-3,${1}} (server: ${2}, noact: ${3}, format: ${4}, regex: ${5}) ${6}",
.strhandle = config_redraws,
.description = {
"Format of ignore list messages.", NULL}},
@@ -341,7 +341,7 @@ struct Config config[] = {
.description = {
"Format of ignore list footer.", NULL}},
{"format.ui.ignores.added", 1, Val_string,
- .str = "Ignore added: ${4} (server: ${1}, noact: ${2}, format: ${3})",
+ .str = "Ignore added: ${5} (server: ${1}, noact: ${2}, format: ${3}, regex: ${4})",
.strhandle = config_redraws,
.description = {
"Format of new ignores.", NULL}},