Consider the following vim code.
function! s:foo()
if s:bar()
let a = 1
endif
endfunction
function! s:bar()
python << EOF
vim.command('echoerr "blabla"')
EOF
endfunction
command! Foo call s:foo()
map <F7> :Foo<CR>
Open a vim session and press F7.
Vim wil then throw an error saying E171: Missing :endif
.
How is this possible and how can I correctly send an error message inside the python part?