On 22/03/09 21:27, Ingo Karkat wrote:
>
> On 22-Mar-09 20:40, Tony Mechelynck wrote:
>> On 22/03/09 19:02, Britton Kerin wrote:
>>>
>>> I wrote a plugin, and following the description of how to do
>>> key bindings I ended up with
>>>
>>>       <Plug>IsymchooseComplete
>>>
>>> available.  I'd like to advise users what to put in their .vimrc
>>> in order to enable completion from insert mode.  This works:
>>>
>>>       imap<S-Tab>   <Plug>IsymchooseComplete<Esc>:call feedkeys("a",
>>>       "n")<CR>
>>>
>>> the trouble is when Isymchoose fails somehow, the message only flashes
>>> for an instant and is then removed by the fed keys which I use to drop
>>> back into insert mode.  I'd like to avoid this.
>>>
>>> I'd like to use just
>>>
>>>       imap<S-Tab>   <Plug>IsymchooseComplete
>>>
>>> but this seems to end insert mode.
>>>
>>> Any help or advice greatly appreciated.
>>>
>>> Britton
>> If Vim fleetingly displays an error message, but too fast for you to
>> readit, you can usually get it back by
>>      :messages
>
> Tony, Britton didn't ask for a user workaround, but for how to prevent the
> problem as a script writer?!
>
> Britton,
> It's hard to help without knowing what's behind your<Plug>IsymchooseComplete
> mapping. Usually, insert-mode mappings begin with<C-O>  to :call a custom
> function and immediately go back to insert mode:
>       CTRL-O          execute one command, return to Insert mode   *i_CTRL-O*
> as in e.g.:
>       inoremap<Plug>IsymchooseComplete<C-o>:set
> completefunc=<SID>IsymchooseComplete<CR><C-x><C-u>
> This should work for you, too, so you don't need to use feedkeys(). If your
> mapping implements a custom completion, also see :help complete-functions for
> more information on how to implement them.
>
> -- regards, ingo
>

What is <Plug>IsymchooseComplete ? Is it the {lhs} of another 
Insert-mode mapping? Of a Normal-mode mapping? An Ex-command? In the 
latter two cases, <Esc> or <C-O> (followed by a colon in the case of an 
ex-command) should appear first, in order to escape from Insert mode.

Also, if Britton knew what the error message was (e.g. with the help of 
":messages") he might guess more easily what to do about it.


Best Regards,
Tony.
-- 
        THE LESSER-KNOWN PROGRAMMING LANGUAGES #18: C-

This language was named for the grade received by its creator when he
submitted it as a class project in a graduate programming class.  C- is
best described as a "low-level" programming language.  In fact, the
language generally requires more C- statements than machine-code
statements to execute a given task.  In this respect, it is very
similar to COBOL.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui