I would like the items in the popupmenu to be more than simple strings, i
mean that after i select an item i want the cursor to automatically jump to
specific locations.

let me give a simple example, from JavaScript:
when i type:
    document.getEle
and then
   <c-x><c-o>
i want it to complete to
    document.getElementById()
but that is NOT enough, i want the cursor to MOVE <left>, so it will already
be between the parentheses after i select the completion.

Now, in the help files there is a vague paragraph that implies that
theoretically this is possible, i mean in insert.txt (line 613)
it says the following:
        "Note: While completion is active Insert mode can't be used
recursively.
        Mappings that somehow invoke ":normal i.." will generate an E523
error."

I mean, it warns against invoking the insert mode recursively, but could it
be possible in the first place?
Because in order to invoke the :normal command you must first ESCAPE the
insert mode, now what is the trick to do that from INSIDE an item of the
popupmenu?
if i look in the example (insert.txt line 1059), the res variable is always
set to a list of "simple" strings that do no more than to complete a string
but not so much as to complete the magic by jumping the cursor from place to
place, and in order to do that, you must first ESCAPE the insert mode or to
let the function interpret the <left><up> etc. inside the strings (as in
mapping and abbreviations), but can we do that?


Thanks in advance for ANY help, please keep in mind that im new to vim so
that ANY help would be much appreciated.

Alex 
-- 
View this message in context: 
http://vim.1045645.n5.nabble.com/how-to-write-omnifunction-tp2637764p2637764.html
Sent from the Vim - General mailing list archive at Nabble.com.

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

Reply via email to