Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: (large) initial support for combining characters in ZLE.



On 15/04/2008, Peter Stephenson <pws@xxxxxxx> wrote:
> On Tue, 15 Apr 2008 15:58:54 +0200
>
> "Mikael Magnusson" <mikachu@xxxxxxxxx> wrote:
>
> > This is better, but I can still put the cursor between the a and the ~.
>  > >  > % zsh -f
>  > >  > % setopt combiningchars
>  > >  > % print -z $'\u0342'
>  > >  > the buffer should now contain an inverted <0342>, press left or ctrl-a
>  > >  > or whatever to go to the start of the line and press 'a'.
>  > But instead of pressing a, type a '!' and go left again and press 'a',
>  > then press ctrl-d. (or ctrl-t)
>
>
> OK, so we need to fix things up right at the end after an operation in case
>  it generated some combinations a sneaky way.  Hence some more CCRIGHT()s.
>
>
>  > Another thing I noticed is that ctrl-t moves just the combining char,
>  > not the whole base+combiningchar, but that might already be on your
>  > todo as a subset of "fix widgets" :).
>
>
> This should help with fixing the word stuff, when I get round to it...
>
>  I'm fed up with the names zle_misc.c and zle_utils.c.  I can never find
>  anything.

I wonder if I'm just being evil now...

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>
...
sorry :)

-- 
Mikael Magnusson



Messages sorted by: Reverse Date, Date, Thread, Author