Describe the bug
In Vim9 script, we cannot compile an :if command when it's preceded by the :legacy modifier.
To Reproduce
Run this shell command:
vim -Nu NONE -S <(cat <<'EOF'
vim9script
def Func()
legacy if 1
echo 'no error'
endif
enddef
defcompile
EOF
)
E580 is raised:
E580: :endif without :if
Expected behavior
No error is raised.
Environment
Additional context
At the script level, the code works fine:
vim9script legacy if 1 echo 'no error' endif
no error
Which seems inconsistent.
No issue with other modifiers; like :silent for example:
vim9script def Func() silent if !!execute('ls', '') endif enddef defcompile
Again, this seems inconsistent. If Vim can compile :silent if, why not :legacy if?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()