[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Ncursesw bug in refreshing wide character (with patch)
From: |
Thomas Dickey |
Subject: |
Re: Ncursesw bug in refreshing wide character (with patch) |
Date: |
Sat, 8 Jan 2005 13:54:40 -0500 |
User-agent: |
Mutt/1.5.6+20040907i |
On Wed, Jan 05, 2005 at 02:10:37PM +0900, Eungkyu Song wrote:
> I don't see broken wide character with scroll with scroll. But my second
> part of patch is not applied. It is not scroll problem. When I read a mail
> from mutt (screen is changed from index to pager), first line of screen is
> changed to pager menu from index menu and wide character of pager menu is
> broken.
>
> for example in korean, (it have EUC-KR encoded characters)
>
> 'q:???? d:???? u:???? s:???? m:???? r:???? g:???? ?:??????'
> should changed to
> 'i:???? ^B:?????????? ^F:?????????? v:?????????? d:???? r:???? ?:??????'
> but
> 'i:???? ^B:?????????? ^F:?????????? v:?????????? d:??? r:???? ? ?:??????'
> is displayed.
>
> It is because ncursesw try to insert string second byte of wide
> character which is not a character.
>
> The second part of my patch is to fix it. But it is not applied.
> I think my patch should be edited because isnac() is not exist
> anymore. But you may fix this bug easily :)
It seems you are talking about this chunk (adapted). There are three pieces
in your patch. But I'm not sure how to test it:
===================================================================
RCS file: tty/RCS/tty_update.c,v
retrieving revision 1.213
diff -u -r1.213 tty/tty_update.c
--- tty/tty_update.c 2005/01/02 01:33:32 1.213
+++ tty/tty_update.c 2005/01/08 18:50:22
@@ -1297,11 +1297,19 @@
if (oLastChar < nLastChar) {
int m = max(nLastNonblank, oLastNonblank);
- GoTo(lineno, n + 1);
if (InsCharCost(nLastChar - oLastChar)
> (m - n)) {
+ GoTo(lineno, n + 1);
PutRange(oldLine, newLine, lineno, n + 1, m);
} else {
+#if USE_WIDEC_SUPPORT
+ if (isWidecExt(newLine[n + 1])) {
+ GoTo(lineno, n);
+ PutRange(oldLine, newLine, lineno, n, n + 1);
+ n++;
+ }
+#endif
+ GoTo(lineno, n + 1);
InsStr(&newLine[n + 1], nLastChar - oLastChar);
}
} else if (oLastChar > nLastChar) {
If that is what you are talking about, this is simpler:
===================================================================
RCS file: tty/RCS/tty_update.c,v
retrieving revision 1.213
diff -u -r1.213 tty/tty_update.c
--- tty/tty_update.c 2005/01/02 01:33:32 1.213
+++ tty/tty_update.c 2005/01/08 18:52:53
@@ -1298,8 +1298,10 @@
if (oLastChar < nLastChar) {
int m = max(nLastNonblank, oLastNonblank);
GoTo(lineno, n + 1);
- if (InsCharCost(nLastChar - oLastChar)
- > (m - n)) {
+ if (InsCharCost(nLastChar - oLastChar) > (m - n)
+#if USE_WIDEC_SUPPORT
+ || isWidecExt(newLine[n + 1])
+ ) {
PutRange(oldLine, newLine, lineno, n + 1, m);
} else {
InsStr(&newLine[n + 1], nLastChar - oLastChar);
--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net
signature.asc
Description: Digital signature