mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-13 01:31:18 +02:00
21957: more wide-character refresh stuff
This commit is contained in:
parent
4dae429ba3
commit
4f683c2eea
2 changed files with 134 additions and 110 deletions
|
@ -1,3 +1,11 @@
|
|||
2005-10-30 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* 21957: Src/Zle/zle_refresh.c: more wide character stuff.
|
||||
|
||||
* 21954 (plus comment): configure.ac: use /dev/fd/3 to check
|
||||
for availability of feature (works around FreeBSD 5
|
||||
configuration).
|
||||
|
||||
2005-10-28 Wayne Davison <wayned@users.sourceforge.net>
|
||||
|
||||
* 21948: Src/zsh.h, Src/Zle/zle_refresh.c: fixed a couple
|
||||
|
|
|
@ -1069,6 +1069,9 @@ refreshline(int ln)
|
|||
/* 3: main display loop - write out the buffer using whatever tricks we can */
|
||||
|
||||
for (;;) {
|
||||
#ifdef MULTIBYTE_SUPPORT
|
||||
if ((!*nl || *nl != WEOF) && (!*ol || *ol != WEOF)) {
|
||||
#endif
|
||||
if (*nl && *ol && nl[1] == ol[1]) {
|
||||
/* skip only if second chars match */
|
||||
#ifdef MULTIBYTE_SUPPORT
|
||||
|
@ -1176,11 +1179,21 @@ refreshline(int ln)
|
|||
tc_inschars(i);
|
||||
zwrite(nl, i);
|
||||
nl += i;
|
||||
#ifdef MULTIBYTE_SUPPORT
|
||||
while (*nl == WEOF) {
|
||||
nl++;
|
||||
i++;
|
||||
}
|
||||
#endif
|
||||
char_ins += i;
|
||||
ccs = (vcs += i);
|
||||
/* if we've pushed off the right, truncate oldline */
|
||||
for (i = 0; *(ol + i) && i < winw - ccs; i++);
|
||||
if (i == winw - ccs) {
|
||||
#ifdef MULTIBYTE_SUPPORT
|
||||
while (ol[i] == WEOF)
|
||||
i++;
|
||||
#endif
|
||||
if (i >= winw - ccs) {
|
||||
*(ol + i) = ZWC('\0');
|
||||
ins_last = 1;
|
||||
}
|
||||
|
@ -1191,6 +1204,9 @@ refreshline(int ln)
|
|||
continue;
|
||||
}
|
||||
}
|
||||
#ifdef MULTIBYTE_SUPPORT
|
||||
}
|
||||
#endif
|
||||
/* we can't do any fancy tricks, so just dump the single character
|
||||
and keep on trying */
|
||||
#ifdef MULTIBYTE_SUPPORT
|
||||
|
@ -1204,7 +1220,7 @@ refreshline(int ln)
|
|||
* Make sure we always overwrite the complete width of
|
||||
* a character that was there before.
|
||||
*/
|
||||
} while (*ol == WEOF && *nl);
|
||||
} while ((*ol == WEOF && *nl) || (*nl == WEOF && *ol));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue