mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-17 00:31:09 +02:00
21942: another extra-wide character fix
This commit is contained in:
parent
d7a37f48fd
commit
5f11a38bea
2 changed files with 34 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2005-10-28 Peter Stephenson <pws@csr.com>
|
||||||
|
|
||||||
|
* 21942: Src/Zle/zle_fresh.c: another bug found when deleting
|
||||||
|
an extra-wide character.
|
||||||
|
|
||||||
2005-10-26 Peter Stephenson <pws@csr.com>
|
2005-10-26 Peter Stephenson <pws@csr.com>
|
||||||
|
|
||||||
* 21939: Src/Zle/zle_thingy.c: new UNMETACHECK() was too ruthless.
|
* 21939: Src/Zle/zle_thingy.c: new UNMETACHECK() was too ruthless.
|
||||||
|
|
|
@ -1069,9 +1069,22 @@ refreshline(int ln)
|
||||||
/* 3: main display loop - write out the buffer using whatever tricks we can */
|
/* 3: main display loop - write out the buffer using whatever tricks we can */
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (*nl && *ol && nl[1] == ol[1]) /* skip only if second chars match */
|
if (*nl && *ol && nl[1] == ol[1]) {
|
||||||
|
/* skip only if second chars match */
|
||||||
|
#ifdef ZLE_UNICODE_SUPPORT
|
||||||
|
int ccs_was = ccs;
|
||||||
|
#endif
|
||||||
/* skip past all matching characters */
|
/* skip past all matching characters */
|
||||||
for (; *nl && (*nl == *ol); nl++, ol++, ccs++) ;
|
for (; *nl && (*nl == *ol); nl++, ol++, ccs++) ;
|
||||||
|
#ifdef ZLE_UNICODE_SUPPORT
|
||||||
|
/* Make sure ol and nl are pointing to real characters */
|
||||||
|
while ((*nl == WEOF || *ol == WEOF) && ccs > ccs_was) {
|
||||||
|
nl--;
|
||||||
|
ol--;
|
||||||
|
ccs--;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
if (!*nl) {
|
if (!*nl) {
|
||||||
if (ccs == winw && hasam && char_ins > 0 && ins_last
|
if (ccs == winw && hasam && char_ins > 0 && ins_last
|
||||||
|
@ -1125,7 +1138,8 @@ refreshline(int ln)
|
||||||
|
|
||||||
/* inserting & deleting chars: we can if there's no right-prompt */
|
/* inserting & deleting chars: we can if there's no right-prompt */
|
||||||
if ((ln || !put_rpmpt || !oput_rpmpt)
|
if ((ln || !put_rpmpt || !oput_rpmpt)
|
||||||
&& (nl[1] && ol[1] && nl[1] != ol[1])) {
|
&& (nl[1] && ol[1] && nl[1] != ol[1])
|
||||||
|
&& *ol != WEOF && *nl != WEOF) {
|
||||||
|
|
||||||
/* deleting characters - see if we can find a match series that
|
/* deleting characters - see if we can find a match series that
|
||||||
makes it cheaper to delete intermediate characters
|
makes it cheaper to delete intermediate characters
|
||||||
|
@ -1177,9 +1191,19 @@ refreshline(int ln)
|
||||||
}
|
}
|
||||||
/* we can't do any fancy tricks, so just dump the single character
|
/* we can't do any fancy tricks, so just dump the single character
|
||||||
and keep on trying */
|
and keep on trying */
|
||||||
|
#ifdef ZLE_UNICODE_SUPPORT
|
||||||
|
do {
|
||||||
|
#endif
|
||||||
zputc(*nl);
|
zputc(*nl);
|
||||||
nl++, ol++;
|
nl++, ol++;
|
||||||
ccs++, vcs++;
|
ccs++, vcs++;
|
||||||
|
#ifdef ZLE_UNICODE_SUPPORT
|
||||||
|
/*
|
||||||
|
* Make sure we always overwrite the complete width of
|
||||||
|
* a character that was there before.
|
||||||
|
*/
|
||||||
|
} while (*ol == WEOF && *nl);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue