$ vim -u NONE
:source foo.vim
foo.vim:
function RunLua() abort
lua<<EOF
local foo = {
change = {},
insert = {},
append = {},
}
EOF
endfunction
E126: Missing :endfunction
The heredoc block should run without any errors -- even if the heredoc script contains a word like change, append, insert, etc. Those words are some kind of special directives (see :lua-heredoc) but they impact on parsing function ... endfunction blocks.
macOS
Vim 8.2 and Nightly
See https://github.com/neovim/neovim/issues/16136 for the downstream issue on Neovim. I believe this is a vim bug. Implementation of parsing heredoc: https://github.com/vim/vim/blob/master/src/userfunc.c#L940
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
![]()
Steps to reproduce
$ vim -u NONE :source foo.vimfoo.vim:
function RunLua() abort lua<<EOF
Indeed, when lua<<EOF is changed to lua <<EOF the error can no longer be reproduced in either Vim or Nvim.
—
You are receiving this because you commented.
And this is also what the documentation says:
:[range]lua << [endmarker]
{script}
{endmarker}
—
You are receiving this because you commented.
closing then.
—
You are receiving this because you commented.