Tony Mechelynck wrote:

> Gerald Lai wrote:
> > Hi all,
> >
> > [On Windows Vim 7.0, binary at ftp://ftp.vim.org/pub/vim/pc/gvim70.exe]
> > I'm having trouble getting the example in
> >
> > :help complete()
> >
> > to work. When I hit <F5> in Insert mode, I get this:
> >
> > Error detected while processing function ListMonths:
> > line 1:
> > E523: Not allowed here
> >
> > I have :set nosecure.
> > Having this instead fixes the problem:
> >
> > inoremap <F5> <C-r>=ListMonths()<CR>
> >
> > Looks like a bug. I wasn't sure if this has been fixed.
> > -- 
> > Gerald
> >
> >
> Looks to me like a documentation bug. I believe you got it right, and 
> the helpfile got it wrong.

The problem with the expression mapping is that it can't change the
text, and that is what is being attempted by complete().  This
protection was added after discovering that expression mappings could
cause trouble.

Using CTRL-R = works.  But I'll see if it can also be made to work as
documented.

-- 
If I tell you "you have a beautiful body", would you hold it against me?

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