about summary refs log tree commit diff
path: root/Src/Modules
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2024-03-05 00:11:02 +0100
committerOliver Kiddle <opk@zsh.org>2024-03-05 00:11:02 +0100
commit05c7b21e2b30873d002b50b37e2fbd3803d4b608 (patch)
tree70dc55c5c22cb1c245ab4f7d241ce95ca6cc7957 /Src/Modules
parent36a2d5cfa49a6b7d699269cb4f22d5f3d0255bc8 (diff)
downloadzsh-05c7b21e2b30873d002b50b37e2fbd3803d4b608.tar.gz
zsh-05c7b21e2b30873d002b50b37e2fbd3803d4b608.tar.xz
zsh-05c7b21e2b30873d002b50b37e2fbd3803d4b608.zip
52646: extend support for highlight groups to completion explanation strings and WATCHFMT
Diffstat (limited to 'Src/Modules')
-rw-r--r--Src/Modules/watch.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/Src/Modules/watch.c b/Src/Modules/watch.c
index 97d4fa608..ba17cf940 100644
--- a/Src/Modules/watch.c
+++ b/Src/Modules/watch.c
@@ -373,6 +373,13 @@ watchlog2(int inout, WATCH_STRUCT_UTMP *u, char *fmt, int prnt, int fini)
 		case 'f':
 		    tunsetattrs(TXTFGCOLOUR);
 		    break;
+		case 'H':
+		    if (*fmt == '{') {
+			fmt = parsehighlight(fmt + 1, '}', &atr);
+			if (atr && atr != TXT_ERROR)
+			    treplaceattrs(atr);
+		    }
+		    break;
 		case 'K':
 		    if (*fmt == '{') {
 			fmt++;
@@ -428,7 +435,7 @@ watchlog_match(char *teststr, char *actual, size_t buflen)
     int ret = 0;
     Patprog pprog;
     char *str = dupstring(teststr);
-    int len = strnlen(actual, buflen);
+    size_t len = strnlen(actual, buflen);
     char *user = metafy(actual, len,
 	    len == buflen ? META_HEAPDUP : META_USEHEAP);