Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: displaying wide characters
- X-seq: zsh-workers 21936
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Subject: Re: PATCH: displaying wide characters
- Date: Wed, 26 Oct 2005 00:11:54 +0100
- Cc: pws@xxxxxxx, zsh-workers@xxxxxxxxxx
- In-reply-to: <237967ef0510240140g548e0c0r3deb3f4704dc313@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <200510192031.j9JKVYk7010115@xxxxxxxxxxxxxxxxx> <200510192041.j9JKfTJZ010450@xxxxxxxxxxxxxxxxx> <237967ef0510191739t103352a9vad735334a790d8b5@xxxxxxxxxxxxxx> <EXCHANGE03zfSLZZInL00006f40@xxxxxxxxxxxxxxxxxx> <237967ef0510240140g548e0c0r3deb3f4704dc313@xxxxxxxxxxxxxx>
On Mon, 24 Oct 2005 10:40:42 +0200
Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> Found one issue with editing wide characters on the command line,
> input some doublewidth characters, erase one near the left end, then
> go to the right and erase another. The second time the cursor will
> only move one character to the left instead of two and cursor display
> will not correspond with reality anymore. For some reason it only
> seems to happen with 6 characters or more, the ones i'm using are
> hiragana.
I think the following patch fixes this issue, at least what I was
seeing. I'm quite sure there are plenty of other oddities like this.
I also think that, while you can now type a line of double-width
characters that wraps without the display going, there are likely to be
problems when you edit the part of the line before the wrap.
Index: Src/Zle/zle_refresh.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_refresh.c,v
retrieving revision 1.33
diff -u -r1.33 zle_refresh.c
--- Src/Zle/zle_refresh.c 24 Oct 2005 16:58:43 -0000 1.33
+++ Src/Zle/zle_refresh.c 25 Oct 2005 23:09:09 -0000
@@ -1138,6 +1138,12 @@
tc_delchars(i);
ol += i;
char_ins -= i;
+#ifdef ZLE_UNICODE_SUPPORT
+ while (*ol == WEOF) {
+ ol++;
+ char_ins--;
+ }
+#endif
i = 0;
break;
}
--
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page still at http://www.pwstephenson.fsnet.co.uk/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author