summaryrefslogtreecommitdiffstats
path: root/Src
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2025-11-17 04:32:05 +0100
committerOliver Kiddle <opk@zsh.org>2025-11-17 04:32:05 +0100
commitec29b4c137f79f525267b56879be206eebda5639 (patch)
tree0610faccd4cd92935877f0cfbde88de838bd11c8 /Src
parent54034: ignore completer filenames with funny characters in them (diff)
downloadzsh-ec29b4c137f79f525267b56879be206eebda5639.tar
zsh-ec29b4c137f79f525267b56879be206eebda5639.tar.gz
zsh-ec29b4c137f79f525267b56879be206eebda5639.tar.bz2
zsh-ec29b4c137f79f525267b56879be206eebda5639.tar.lz
zsh-ec29b4c137f79f525267b56879be206eebda5639.tar.xz
zsh-ec29b4c137f79f525267b56879be206eebda5639.tar.zst
zsh-ec29b4c137f79f525267b56879be206eebda5639.zip
54075: allow highlighting to be reset in prompts using %H without following braces
Diffstat (limited to 'Src')
-rw-r--r--Src/Modules/watch.c3
-rw-r--r--Src/Zle/complist.c4
-rw-r--r--Src/Zle/zle_tricky.c3
-rw-r--r--Src/prompt.c10
4 files changed, 13 insertions, 7 deletions
diff --git a/Src/Modules/watch.c b/Src/Modules/watch.c
index 0d86142c1..bb27ab9db 100644
--- a/Src/Modules/watch.c
+++ b/Src/Modules/watch.c
@@ -378,7 +378,8 @@ watchlog2(int inout, WATCH_STRUCT_UTMP *u, char *fmt, int prnt, int fini)
fmt = parsehighlight(fmt + 1, '}', &atr, NULL);
if (atr && atr != TXT_ERROR)
treplaceattrs(atr);
- }
+ } else
+ treplaceattrs(0);
break;
case 'K':
if (*fmt == '{') {
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index 4c87c15d7..9c26b6f99 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -1186,7 +1186,9 @@ compprintfmt(char *fmt, int n, int dopr, int doesc, int ml, int *stop)
p = parsehighlight(p + 1, '}', &atr, NULL);
if (atr != TXT_ERROR && dopr)
treplaceattrs(atr);
- }
+ } else
+ treplaceattrs(0);
+
break;
case ZWC('{'):
if (arg)
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index f399ebd00..8f32c68e3 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -2507,7 +2507,8 @@ printfmt(char *fmt, int n, int dopr, int doesc)
--p;
if (atr != TXT_ERROR)
treplaceattrs(atr);
- }
+ } else
+ treplaceattrs(0);
break;
case '{':
if (arg)
diff --git a/Src/prompt.c b/Src/prompt.c
index 83a7667cc..e4e3feb89 100644
--- a/Src/prompt.c
+++ b/Src/prompt.c
@@ -641,10 +641,12 @@ putpromptchar(int doprint, int endchar)
if (bv->fm[1] == '{') {
bv->fm = parsehighlight(bv->fm + 2, '}', &atr, NULL);
--bv->fm;
- if (atr != TXT_ERROR) {
- treplaceattrs(atr);
- applytextattributes(TSC_PROMPT);
- }
+ } else {
+ atr = 0;
+ }
+ if (atr != TXT_ERROR) {
+ treplaceattrs(atr);
+ applytextattributes(TSC_PROMPT);
}
break;
case '[':