David Fishburn wrote:

> I am using vim70f on WinXP SP2.
> 
> function! sqlcomplete#DrillIntoTable()
>     if pumvisible()
>          exec "normal! i\<C-Y>"
>          " call sqlcomplete#Map('column')
>          call feedkeys("\<C-X>\<C-O>")
>     endif
>      return ""
> Endfunction
> 
> imap <buffer> <c-right>  <C-R>=sqlcomplete#DrillIntoTable()<CR>
> 
> When the omni popup is visible, to get the current selected item you must
> press <C-Y> while in insert mode (and the list visible).  I am trying to
> issue a <C-Y> from within my function.  All attempts so far have
> failed.  My latest attempt is this line:
>          exec "normal! i\<C-Y>"
> 
> As soon as the above line executes Vim crashes.

I can reproduce it.  The :normal command invokes Insert mode
recursively, which clears the completion information that still is being
used.  I'll forbid recursive Insert mode when completion is active.

> So Bram, this is 2 things:
> 1.  A bug report.
> 2.  A question, how can I issue a <C-Y> from within a function executing
> during an imap?

An expression mapping should work.

-- 
MARTHA'S WAY: Don't throw out all that leftover wine. Freeze into ice cubes
              for future use in casseroles and sauces.
MY WAY:       What leftover wine?

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

Reply via email to