mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
runtime(vim): Update base-syntax, improve script-interface command highlighting
- Normalise interface heredoc highlighting with that used for :let-heredocs. - Remove interface feature testing. The Lua and Python interface command scripts are now highlighted by default. Loading all syntax files incurs an undesirable load-time burden so highlighting of the less popular MzScheme, Perl, Ruby and Tcl interfaces is disabled by default. g:vimsyn_embed can still be used to customise the supported interfaces. - Always highlight interface ex-commands as valid commands, even when the corresponding command-script highlighting is disabled. - Highlight simple command-script statements as well as heredocs. - Remove error highlighting of heredoc and statement command-script regions when an interface is disabled. These are now highlighted as plain text. - Allow indented heredoc end tokens when "trim" is specified. - Match interface heredocs in :def functions. - Fix runaway vimEmbedError regions. These regions have been removed. - Use python2 syntax for :python, and :pythonx when 'pyxversion' is appropriately set. closes: #15522 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
2a1e253e26
commit
a577e4289c
159
runtime/syntax/testdir/input/vim_ex_python.vim
Normal file
159
runtime/syntax/testdir/input/vim_ex_python.vim
Normal file
@@ -0,0 +1,159 @@
|
||||
" Vim :python, :pydo and :pyfile commands
|
||||
" Vim :python3, :py3do and :py3file commands
|
||||
" Vim :pythonx, :pyxdo and :pyxfile commands
|
||||
" VIM_TEST_SETUP let g:vimsyn_embed = "P"
|
||||
" VIM_TEST_SETUP let g:vimsyn_folding = "fP"
|
||||
" VIM_TEST_SETUP setl fdc=2 fdl=99 fdm=syntax
|
||||
|
||||
|
||||
lua << EOF
|
||||
print("Lua script")
|
||||
EOF
|
||||
|
||||
lua << trim EOF
|
||||
print("Lua script")
|
||||
EOF
|
||||
|
||||
lua <<
|
||||
print("Lua script")
|
||||
.
|
||||
|
||||
lua << trim
|
||||
print("Lua script")
|
||||
.
|
||||
|
||||
function Foo()
|
||||
lua << trim EOF
|
||||
print("Lua script in :func")
|
||||
EOF
|
||||
endfunction | call Foo()
|
||||
|
||||
def Bar()
|
||||
lua << trim EOF
|
||||
print("Lua script in :def")
|
||||
EOF
|
||||
enddef | call Bar()
|
||||
|
||||
lua print("Lua statement")
|
||||
"\ comment
|
||||
\ print("Lua statement again")
|
||||
|
||||
luado print("Lua statement")
|
||||
"\ comment
|
||||
\ print("Lua statement again")
|
||||
|
||||
luafile foo.lua
|
||||
|
||||
|
||||
" :mzscheme and :mzfile
|
||||
|
||||
mzscheme << trim EOF
|
||||
(display "MzScheme script")
|
||||
EOF
|
||||
|
||||
mzscheme (display "MzScheme statement")
|
||||
"\ comment
|
||||
\ (display "MzScheme statement again")
|
||||
|
||||
mzfile foo.rkt
|
||||
|
||||
|
||||
" :perl and :perldo
|
||||
|
||||
perl << trim EOF
|
||||
print("Perl script\n")
|
||||
EOF
|
||||
|
||||
perl print("Perl statement\n");
|
||||
"\ comment
|
||||
\ print("Perl statement again\n")
|
||||
|
||||
perldo print("Perl statement\n");
|
||||
"\ comment
|
||||
\ print("Perl statement again\n")
|
||||
|
||||
|
||||
" :python, :pydo and :pyfile
|
||||
|
||||
python << trim EOF
|
||||
print("Python script")
|
||||
EOF
|
||||
|
||||
python print("Python statement");
|
||||
"\ comment
|
||||
\ print("Python statement again")
|
||||
|
||||
pydo print("Python statement");
|
||||
"\ comment
|
||||
\ print("Python statement again")
|
||||
|
||||
pyfile foo.py
|
||||
|
||||
|
||||
" :python3, :py3do and :py3file
|
||||
|
||||
python3 << trim EOF
|
||||
print("Python3 script")
|
||||
EOF
|
||||
|
||||
python3 print("Python3 statement");
|
||||
"\ comment
|
||||
\ print("Python3 statement")
|
||||
|
||||
py3do print("Python3 statement");
|
||||
"\ comment
|
||||
\ print("Python3 statement")
|
||||
|
||||
py3file foo.py
|
||||
|
||||
|
||||
" :pythonx, :pyxdo and :pyxfile
|
||||
|
||||
pythonx << trim EOF
|
||||
print("PythonX script")
|
||||
EOF
|
||||
|
||||
pythonx print("PythonX statement");
|
||||
"\ comment
|
||||
\ print("PythonX statement")
|
||||
|
||||
pyxdo print("PythonX statement");
|
||||
"\ comment
|
||||
\ print("PythonX statement")
|
||||
|
||||
pyxfile foo.py
|
||||
|
||||
|
||||
" :ruby, :rubydo and :rubyfile
|
||||
|
||||
ruby << trim EOF
|
||||
puts "Ruby script"
|
||||
EOF
|
||||
|
||||
ruby puts "Ruby statement";
|
||||
"\ comment
|
||||
\ puts "Ruby statement again"
|
||||
|
||||
rubydo puts "Ruby statement";
|
||||
"\ comment
|
||||
\ puts "Ruby statement again"
|
||||
|
||||
rubyfile foo.rb
|
||||
|
||||
|
||||
" :tcl, :tcldo and :tclfile
|
||||
|
||||
tcl << trim EOF
|
||||
puts "TCL script"
|
||||
EOF
|
||||
|
||||
tcl puts "TCL statement";
|
||||
"\ comment
|
||||
\ puts "TCL statement again"
|
||||
|
||||
tcldo puts "TCL statement";
|
||||
"\ comment
|
||||
\ puts "TCL statement again"
|
||||
|
||||
tclfile foo.tcl
|
||||
|
Reference in New Issue
Block a user