On 22-Oct-2011 19:47, Bram Moolenaar wrote:

> Yasuhiro Matsumoto wrote:
> 
>>> I'm not sure if InsertCharPre should apply when the popup menu is
>>> visible, keys mean something else then.  Perhaps we would need another
>>> event for that sitiuation?
>>>
>> No. I think that it can avoid to insert 'f' with checking pumvisible() while 
>> popup menu is shown.
>>
>> autocmd InsertCharPre * let v:char = pumvisible() ? v:char : 'f'
> 
> The question is if plugin authors that use InsertCharPre are aware of
> the possibility that the event will be triggered in other circumstances
> than typing text to be inserted.

Isn't that mostly a matter of documenting it?

I, for one, would appreciate the possibility to "remap" the keys in the special
"pumvisible" mode (e.g. the CTRL-X_CTRL-N "copy the words following the previous
expansion"). Please forgive my ignorance, I haven't yet tried whether that is
now possible with InsertCharPre and changing v:char, but I remember that I once
wanted to remap those keys and found out that I couldn't via the usual :imap
commands.

(A (compatibility-breaking) alternative would be to extend the popup menu into a
proper sub-mode of insert mode, complete with :pummap, etc.; I have never found
the pumvisible() checks for insert-mode mappings particularly elegant.)

-- regards, ingo

-- 
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

Raspunde prin e-mail lui