On Sun, 11 Jun 2006, A.J.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.
Best regards,
Tony.
Does this mean that <expr> isn't allowed for complete()? It mentioned at
the top of ":help complete()" that both :map-<expr> and <C-r>= were
allowed. Isn't
imap <expr> <F5> MyFunction()
and
imap <F5> <C-r>=MyFunction()<CR>
pretty much the same? Or at the very least, the same in terms of
security (see :help E523)?
--
Gerald