diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2008-04-22 15:08:04 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2008-04-22 15:08:04 +0000 |
commit | 2cec7aae44579d9d8ca8c7e728f9eb6e2840d72f (patch) | |
tree | a1725b9e9fba5cc1959b029167bd8137183cf092 /Src/Zle/zle_refresh.c | |
parent | a58d02fd2e11f8453b912859b2f774b6cadace4c (diff) | |
download | zsh-2cec7aae44579d9d8ca8c7e728f9eb6e2840d72f.tar.gz zsh-2cec7aae44579d9d8ca8c7e728f9eb6e2840d72f.tar.xz zsh-2cec7aae44579d9d8ca8c7e728f9eb6e2840d72f.zip |
24861 (with tweaks): logic to use alternative wcwidth() if needed;
slightly improve test for overwriting with combining characters.
Diffstat (limited to 'Src/Zle/zle_refresh.c')
-rw-r--r-- | Src/Zle/zle_refresh.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Src/Zle/zle_refresh.c b/Src/Zle/zle_refresh.c index a9bc017f8..66cae9f97 100644 --- a/Src/Zle/zle_refresh.c +++ b/Src/Zle/zle_refresh.c @@ -1222,7 +1222,7 @@ zrefresh(void) } } #ifdef MULTIBYTE_SUPPORT - else if (iswprint(*t) && (width = wcwidth(*t)) > 0) { + else if (iswprint(*t) && (width = WCWIDTH(*t)) > 0) { int ichars; if (width > rpms.sen - rpms.s) { int started = 0; @@ -1397,7 +1397,7 @@ zrefresh(void) for (; u < outputline + outll; u++) { #ifdef MULTIBYTE_SUPPORT if (iswprint(*u)) { - int width = wcwidth(*u); + int width = WCWIDTH(*u); /* Handle wide characters as above */ if (width > rpms.sen - rpms.s) { do { @@ -2144,7 +2144,7 @@ tc_rightcurs(int ct) characters occupying more than one column. We could flag that this has happened (since it's not that common to have characters wider than one column), but for now it's easier not to use the - trick if we are using wcwidth() on the prompt. It's not that + trick if we are using WCWIDTH() on the prompt. It's not that common to be editing in the middle of the prompt anyway, I would think. */ @@ -2264,7 +2264,7 @@ singlerefresh(ZLE_STRING_T tmpline, int tmpll, int tmpcs) if (tmpline[t0] == ZWC('\t')) vsiz = (vsiz | 7) + 2; #ifdef MULTIBYTE_SUPPORT - else if (iswprint(tmpline[t0]) && (width = wcwidth(tmpline[t0]) > 0)) { + else if (iswprint(tmpline[t0]) && (width = WCWIDTH(tmpline[t0]) > 0)) { vsiz += width; if (isset(COMBININGCHARS) && IS_BASECHAR(tmpline[t0])) { while (t0 < tmpll-1 && IS_COMBINING(tmpline[t0+1])) @@ -2340,7 +2340,7 @@ singlerefresh(ZLE_STRING_T tmpline, int tmpll, int tmpcs) vp++; #ifdef MULTIBYTE_SUPPORT } else if (iswprint(tmpline[t0]) && - (width = wcwidth(tmpline[t0])) > 0) { + (width = WCWIDTH(tmpline[t0])) > 0) { int ichars; if (isset(COMBININGCHARS) && IS_BASECHAR(tmpline[t0])) { /* |