1

I have a script written in vimscript-python, e.g.:

function! MyFunction()
python3 << EOF

if <condition>:

return

print('Hello world')

EOF endfunction

I want to add a check in the beginning of the script and if a check fails, the functions execution should be terminated. I tried using return and exit(), but return throws SyntaxError and exit() throws SystemExit exception. I want to stop execution without any errors.

niekas
  • 1,575
  • 4
  • 17
  • 25

0 Answers0