Wednesday, September 24, 2014

Re: Some abbreviations work only as imaps

On Wed, 24 Sep 2014 22:46:59 +0200
Christian Brabandt <cblists@256bit.org> wrote:

>
> On Mi, 24 Sep 2014, Gevisz wrote:
> > Some abbreviations expand as desired and some do not.
> >
> > > Are there any circumstances different between a working
> > > abbreviation and a not working abbreviation?
> >
> > They may be very similar. For example, abbreviation чкпк expands as
> > desired, whereas abbreviation чкпр does not expand at all unless I
> > redefine it via imaps. (The only difference between чкпк and чкпр is
> > in the last cyrillic letter.)
> >
> > > Have you tried, testing with
> > > vim -u NONE -N (to eliminate the effect of any plugins)?
> >
> > I have just tried that. No abbreviation works after starting vim
> > with such parameters. However, when I define these two abbreviation
> > anew in thus started vim, I get the same picture: чкпк abbreviation
> > works and чкпр one do not.
>
> I can reproduce this. Does this always involve the character 'р'?

So far, yes. All abbreviations that have cyrillic letter р anywhere
within its text does not expand, and so far I can not find another
cyrillic letter that produces the same disorder.

Probably, it is because the letter р is special: many "cyrillic"
children cannot pronounce the corresponding sound for years and
substitute it with л. :)

> Bram, problem is, 'р' is U+0440 (0xD1 0x80). As you may now already
> guess, the 0x80 will be parsed as K_SPECIAL and therefore encoded as
> K_SPECIAL KS_SPECIAL KE_FILLER. Now when checking for an
> abbreviation, Vim does not consider that the len of the mapped keys
> might differ from the len of the input chars.
>
> Attached patch fixes this.
>
> Best, Christian

Thank you for solving this problem, Christian.

I am not going to apply your patch myself but will wait until it finds
its way to the official release of Vim.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: