Ответ на сообщение «Problem with feedkeys()», присланное в 18:33:47 17 августа 2010, Вторник, отправитель SirVer:
Maybe you should try using ``normal!'' command? Or feedkeys with string "n" as
a
second argument: I do not know how it interacts with langmap, but it does not
let remapping fed keys by user maps.
Текст сообщения:
> Hi,
>
> I am the developer of UltiSnips, the ultimate snippet solution for
> vim[1]. A user of mine has reported a bug [2] that is hard for me to
> fix and I am in search of inspiration on this list.
>
> UltiSnips selects part of text by using feedkeys(). For example to
> select two lines for overwriting in insert mode, we would use
> something like
> feedkeys("\<Esc>v2j\<c-g>")
> The user now has a langmap set, which remaps the j key and the whole
> scheme falls down. My idea was now to cache the content of the langmap
> option and restore it after the feedkeys() call. Unfortunately, the
> feedkeys() keys are not evaluated till after my script has finished
> running; at this point in time, the langmap is already restored and
> therefore the feedkeys call does not work out.
>
> Is there a way to force the evaluation of the keyboard buffer? Or is
> there maybe a clever autocommand in which I can restore the contents
> of langmap, so that it is not set after my scripts run (so that
> feedkeys() does the right thing) but it is reset as soon as the user
> needs it.
>
> [1] http://www.vim.org/scripts/script.php?script_id=2715
> [2] https://bugs.launchpad.net/ultisnips/+bug/501727
>
> Thanks for your help!
> Holger
signature.asc
Description: This is a digitally signed message part.
