summaryrefslogtreecommitdiff
path: root/Src/Zle/zle_refresh.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-01-13 16:05:46 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-01-13 16:05:46 +0000
commit7e5d340abe68cb521b9bc351db791ea87b7dfc5d (patch)
tree19ff7c304cf55170783a48aac1ea3c6c7848f194 /Src/Zle/zle_refresh.c
parent0cf040f4bf50c5530bd19da76ea234e2cd831667 (diff)
downloadzsh-7e5d340abe68cb521b9bc351db791ea87b7dfc5d.tar.gz
zsh-7e5d340abe68cb521b9bc351db791ea87b7dfc5d.zip
26393: turn off text attributes in refresh when deleting text
Diffstat (limited to 'Src/Zle/zle_refresh.c')
-rw-r--r--Src/Zle/zle_refresh.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c
index ba6fdaaf1..8fb2dff34 100644
--- a/Src/Zle/zle_refresh.c
+++ b/Src/Zle/zle_refresh.c
@@ -1973,8 +1973,18 @@ refreshline(int ln)
eg. oldline: hifoobar \ hopefully cheaper here to delete two
newline: foobar / characters, then we have six matches */
if (tccan(TCDEL)) {
+ int first = 1;
for (i = 1; ol[i].chr; i++)
if (tcdelcost(i) < wpfxlen(ol + i, nl)) {
+ /*
+ * Some terminals will output the current
+ * attributes into cells added at the end by
+ * deletions, so turn off text attributes.
+ */
+ if (first) {
+ clearattributes();
+ first = 0;
+ }
tc_delchars(i);
ol += i;
char_ins -= i;
@@ -1984,15 +1994,6 @@ refreshline(int ln)
char_ins--;
}
#endif
- /*
- * If the sequence we're deleting ended
- * by turning off an attribute, make sure
- * it stays turned off. I don't think we
- * should need this.
- */
- if (ol[-1].atr & TXT_ATTR_OFF_MASK)
- settextattributes(ol[-1].atr &
- TXT_ATTR_OFF_MASK);
i = 0;
break;
}