> When vim only compiled with python 3 support, and we write something
> in test.vim like:
>
> python3 << EOF
> print("Hello, world")
> EOF
>
> The highlight is not what we want. I think following line in
>
> $VIMRUNTIME/syntax/vim.vim is wrong:
>
> if (g:vimsyn_embed =~ 'P' && has("python")) && filereadable(s:pythonpath)
>
> has("python") is false, although has("python3") is true. We should use
> (has("python") || has("python3")) instead. Another solution is just
> drop has("python"). I have wrote a patch for this which attached to
> the letter.
I would rather suggest removing these has() checks at all and for all
interpreters. Why are they there? syntax/python.vim does work without +python,
same for perl, ruby, lua, tcl and mzscheme. There should not be more then one
check for existence of syntax script.
And check for existence is invalid everywhere: it first tries to use file in
the same directory as the syntax/vim.vim, then assumes that there is only one
syntax/{interp}.vim file in rtp which may be false. It is better to use
if stridx(g:vimsyn_embed, 'l')!=-1
try
syntax include @vimLuaScript syntax/lua.vim
let s:use_lua=1
catch /^Vim(syntax):E484:/
let s:use_lua=0
endtry
if s:use_lua
" Lua stuff goes here
endif
endif
. Will create the patch in the evening.
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php