Hi Bram! On Di, 09 Jun 2015, Bram Moolenaar wrote:
> > Christian Brabandt wrote: > > > Bram, > > There are still two open issues with langmaps. One is issue 297 > > (https://code.google.com/p/vim/issues/detail?id=297), the other one is > > this one > > (https://groups.google.com/d/msg/vim_dev/5D1WSL2gj-A/OgCBNZQEHNEJ) > > > > I have checked the problem and I think the problem is, that mappings > > won't be resolved after a multibyte characters have been read. This is > > caused, by the fact that vgetorpeek() that resolves mappings, doesn't > > know about multibyte chars, since those are only known in the higher > > level vgetc() function. But after applying the langmap there, Vim > > won't check, if the input needs to be resolved for mappings. > > > > Therefore I changed vgetc() function to resolve langmaps after the > > multibyte chars have been read correctly and once this changed the > > input character and a mapping for that character exists, put that > > character again into the typeahead buffer and run vgetorpeek() again. > > > > Attached patch includes 2 tests, that are taken from the above issues > > and demonstrate the problem. > > I think this is not right. LANGMAP_ADJUST() is already called inside > vgetorpeek(). After your change it would also be called on the result. Isn't that, what is happening currently anyhow? LANGMAP_ADJUST() is called inside vgetorpeek() and again in normal.c after safe_vgetc() > I think the right solution is to change the code around LANGMAP_ADJUST() > inside vgetorpeek(). It needs to check for the lead byte of a > multi-byte character and get the whole multi-byte character out of > typebuf. There are two such places. The tricky part is checking for a > mappping, because the byte length of a character may change after > applying LANGMAP_ADJUST(). Hm, have to check this again. Best, Christian -- Aus Murphy's Gesetze: Das Können eines Arztes steht im umgekehrten Verhältnis zu seinen Möglichkeiten. -- -- You received this message from the "vim_dev" 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_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.