mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-03 10:21:46 +02:00
26393: turn off text attributes in refresh when deleting text
This commit is contained in:
parent
0cf040f4bf
commit
7e5d340abe
2 changed files with 14 additions and 10 deletions
|
@ -1,5 +1,8 @@
|
|||
2009-01-13 Peter Stephenson <pws@csr.com>
|
||||
|
||||
* 26393: Src/Zle/zle_refresh.c: turn off text attributes when
|
||||
deleting text, to avoid them being used for inserted blanks.
|
||||
|
||||
* unposted: Completion/Base/Utility/_values, Doc/Zsh/compwid.yo,
|
||||
Src/Zle/compcore.c, Src/Zle/complete.c, Src/Zle/compresult.c:
|
||||
Back off 26270 and follow up; was causing memory corruption.
|
||||
|
@ -10901,5 +10904,5 @@
|
|||
|
||||
*****************************************************
|
||||
* This is used by the shell to define $ZSH_PATCHLEVEL
|
||||
* $Revision: 1.4506 $
|
||||
* $Revision: 1.4507 $
|
||||
*****************************************************
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue