Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: (large) initial support for combining characters in ZLE.
- X-seq: zsh-workers 24821
- From: Peter Stephenson <pws@xxxxxxx>
- To: "Zsh Hackers' List" <zsh-workers@xxxxxxxxxx>
- Subject: Re: PATCH: (large) initial support for combining characters in ZLE.
- Date: Wed, 16 Apr 2008 09:47:54 +0100
- In-reply-to: <237967ef0804151828k4d09afc1p1a86283359d78d97@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20080413175442.0e95a241@pws-pc> <237967ef0804140634l7e02ce6fofff7f3f3ec6c8d7c@xxxxxxxxxxxxxx> <20080414145425.566bcb92@news01> <237967ef0804150658h1f8df5e5w422955fc6b92fe29@xxxxxxxxxxxxxx> <20080415174645.0590d589@news01> <237967ef0804151828k4d09afc1p1a86283359d78d97@xxxxxxxxxxxxxx>
"Mikael Magnusson" wrote:
> zsh -f
> setopt interactivecomments
> function toggleopt() {
> #is there some easier way to do this?
> [[ $options[$1] = on ]] && setopt no$1 || setopt $1
> }
> compdef _options toggleopt=setopt
> function _togglecombining() {
> toggleopt combiningchars
> }
> zle -N _togglecombining
> bindkey ^K _togglecombining
> print -z $'a\u0342'
> <press ctrl-k and then left, and ctrl-k again>
I haven't looked at the behaviour of user-defined widgets at all, which
will need much more work, but on exit from a widget is a good place to
fix up the cursor position.
Some more for the FAQ, too.
Index: Etc/FAQ.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Etc/FAQ.yo,v
retrieving revision 1.38
diff -u -r1.38 FAQ.yo
--- Etc/FAQ.yo 14 Apr 2008 12:53:37 -0000 1.38
+++ Etc/FAQ.yo 16 Apr 2008 08:45:51 -0000
@@ -2045,7 +2045,8 @@
be displayed within the same screen area as the base character. As not
all terminals handle this, even if they correctly display the base
multibyte character, this option is not on by default. The KDE terminal
- emulator tt(konsole) is known to handle combining characters.
+ emulator tt(konsole), tt(rxvt-unicode), and the Unicode version of
+ xterm, tt(uxterm), are known to handle combining characters.
The tt(COMBINING_CHARS) option only affects output; combining characters
may always be input, but when the option is off will be displayed
@@ -2157,7 +2158,7 @@
however, using UTF-8 massively extends the number of valid characters
that can be produced.
- See also url(http://www.cl.cam.ac.uk/~mgk25/unicode.html#input)http://www.cl.cam.ac.uk/~mgk25/unicode.html#input)
+ See also url(http://www.cl.cam.ac.uk/~mgk25/unicode.html#input)(http://www.cl.cam.ac.uk/~mgk25/unicode.html#input)
for general information on entering Unicode characters from a keyboard.
Index: Src/Zle/zle_main.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_main.c,v
retrieving revision 1.107
diff -u -r1.107 zle_main.c
--- Src/Zle/zle_main.c 3 Apr 2008 15:30:44 -0000 1.107
+++ Src/Zle/zle_main.c 16 Apr 2008 08:45:52 -0000
@@ -1344,6 +1344,12 @@
}
if (set_bindk)
bindk = save_bindk;
+ /*
+ * Goodness knows where the user's left us; make sure
+ * it's not on a combining character that won't be displayed
+ * directly.
+ */
+ CCRIGHT();
return ret;
}
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author