From 7e5d340abe68cb521b9bc351db791ea87b7dfc5d Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 13 Jan 2009 16:05:46 +0000 Subject: 26393: turn off text attributes in refresh when deleting text --- Src/Zle/zle_refresh.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'Src') 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; } -- cgit 1.4.1