summaryrefslogtreecommitdiff
path: root/Src/subst.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/subst.c')
-rw-r--r--Src/subst.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/Src/subst.c b/Src/subst.c
index b8e4023e1..897188862 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -3716,6 +3716,8 @@ colonsubscript:
if (presc) {
int ops = opts[PROMPTSUBST], opb = opts[PROMPTBANG];
int opp = opts[PROMPTPERCENT];
+ zattr savecurrent = txtcurrentattrs;
+ zattr saveunknown = txtunknownattrs;
if (presc < 2) {
opts[PROMPTPERCENT] = 1;
@@ -3738,7 +3740,8 @@ colonsubscript:
for (; *ap; ap++) {
char *tmps;
untokenize(*ap);
- tmps = promptexpand(*ap, 0, NULL, NULL, NULL);
+ txtunknownattrs = TXT_ATTR_ALL;
+ tmps = promptexpand(*ap, 0, NULL, NULL);
*ap = dupstring(tmps);
free(tmps);
}
@@ -3747,10 +3750,14 @@ colonsubscript:
if (!copied)
val = dupstring(val), copied = 1;
untokenize(val);
- tmps = promptexpand(val, 0, NULL, NULL, NULL);
+ txtunknownattrs = TXT_ATTR_ALL;
+ tmps = promptexpand(val, 0, NULL, NULL);
val = dupstring(tmps);
free(tmps);
}
+
+ txtpendingattrs = txtcurrentattrs = savecurrent;
+ txtunknownattrs = saveunknown;
opts[PROMPTSUBST] = ops;
opts[PROMPTBANG] = opb;
opts[PROMPTPERCENT] = opp;