runtime/syntax/vim.vim: disable g:vimsyn_embed by default

This feature is extremely slow.
Also merge some minor upstream differences (missed by a previous merge).
This commit is contained in:
Justin M. Keyes
2017-09-09 13:14:15 +02:00
parent 12efbf897d
commit 20a79706e2
2 changed files with 17 additions and 14 deletions

View File

@@ -3270,11 +3270,10 @@ improve screen updating rates (see |:syn-sync| for more on this). >
The g:vimsyn_embed option allows users to select what, if any, types of The g:vimsyn_embed option allows users to select what, if any, types of
embedded script highlighting they wish to have. > embedded script highlighting they wish to have. >
g:vimsyn_embed == 0 : don't embed any scripts g:vimsyn_embed == 0 : disable (don't embed any scripts)
g:vimsyn_embed =~ 'P' : support embedded python g:vimsyn_embed == 'lPr' : support embedded lua, python and ruby
< <
By default, g:vimsyn_embed is a string supporting interpreters that your vim This option is disabled by default.
itself supports.
*g:vimsyn_folding* *g:vimsyn_folding*
Some folding is now supported with syntax/vim.vim: > Some folding is now supported with syntax/vim.vim: >

View File

@@ -3,8 +3,8 @@
" ############################################################################# " #############################################################################
" ############################################################################# " #############################################################################
" Note: Be careful when merging the upstream version of this file. " Note: Be careful when merging the upstream version of this file.
" Much of this is generated by scripts/genvimvim.lua (result is installed " Much of this is generated by scripts/genvimvim.lua
" to: $VIMRUNTIME/syntax/vim/generated.vim) " (installs to $VIMRUNTIME/syntax/vim/generated.vim)
" ############################################################################# " #############################################################################
" ############################################################################# " #############################################################################
@@ -128,6 +128,13 @@ if exists("g:vimsyntax_noerror")
let g:vimsyn_noerror= g:vimsyntax_noerror let g:vimsyn_noerror= g:vimsyntax_noerror
endif endif
" Variable options {{{2
if exists("g:vim_maxlines")
let s:vimsyn_maxlines= g:vim_maxlines
else
let s:vimsyn_maxlines= 60
endif
" Numbers {{{2 " Numbers {{{2
" ======= " =======
syn match vimNumber "\<\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand syn match vimNumber "\<\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand
@@ -601,7 +608,7 @@ syn region vimGlobal matchgroup=Statement start='\<v\%[global]!\=/' skip='\\.' e
" g:vimsyn_embed =~# 'r' : embed ruby " g:vimsyn_embed =~# 'r' : embed ruby
" g:vimsyn_embed =~# 't' : embed tcl " g:vimsyn_embed =~# 't' : embed tcl
if !exists("g:vimsyn_embed") if !exists("g:vimsyn_embed")
let g:vimsyn_embed= "lpPr" let g:vimsyn_embed= 0
endif endif
" [-- lua --] {{{3 " [-- lua --] {{{3
@@ -744,9 +751,10 @@ if !filereadable(s:mzschemepath)
endif endif
if g:vimsyn_embed =~# 'm' && filereadable(s:mzschemepath) if g:vimsyn_embed =~# 'm' && filereadable(s:mzschemepath)
unlet! b:current_syntax unlet! b:current_syntax
let iskKeep= &isk let s:iskKeep= &isk
exe "syn include @vimMzSchemeScript ".s:mzschemepath exe "syn include @vimMzSchemeScript ".s:mzschemepath
let &isk= iskKeep let &isk= s:iskKeep
unlet s:iskKeep
VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimMzSchemeScript VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*\z(.*\)$+ end=+^\z1$+ contains=@vimMzSchemeScript
VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*$+ end=+\.$+ contains=@vimMzSchemeScript VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*$+ end=+\.$+ contains=@vimMzSchemeScript
syn cluster vimFuncBodyList add=vimMzSchemeRegion syn cluster vimFuncBodyList add=vimMzSchemeRegion
@@ -761,11 +769,7 @@ unlet s:mzschemepath
if exists("g:vimsyn_minlines") if exists("g:vimsyn_minlines")
exe "syn sync minlines=".g:vimsyn_minlines exe "syn sync minlines=".g:vimsyn_minlines
endif endif
if exists("g:vimsyn_maxlines") exe "syn sync maxlines=".s:vimsyn_maxlines
exe "syn sync maxlines=".g:vimsyn_maxlines
else
syn sync maxlines=60
endif
syn sync linecont "^\s\+\\" syn sync linecont "^\s\+\\"
syn sync match vimAugroupSyncA groupthere NONE "\<aug\%[roup]\>\s\+[eE][nN][dD]" syn sync match vimAugroupSyncA groupthere NONE "\<aug\%[roup]\>\s\+[eE][nN][dD]"