On 27-Feb-09 1:46, Larson, DavidX S wrote:
> Hello all,
> 
> Attached is a patch to fix some syntax highlighting issues I've run across 
> when writing vim scripts. These are the issues the patch fixes:
> 
> 1. Function parameters weren't always highlighted when they were used inside 
> function calls:
>         :call s:mySuperfunction(one, a:param)
>         -> a:param wasn't highlighted
> 2. When a vim function is used as a parameter inside another vim function, 
> only the first function was highlighted:
>         :let resolved = split(substitute(f.filter, '"', '', 'g'))
>         -> substitute wasn't highlighted
> 3. vim function names and parameter names weren't highlighted for exec calls:
>         :exec "let" a:var "=" string(a:default)
>         -> a:var and string weren't highlighted.
> 4. parameter names weren't highlighted inside echo calls:
>         :echo a:msg
>         -> a:msg wasn't highlighted.
> 5. The augroup command wasn't highlighted at all.
> 
> Please try the patch and let me know if you see any problems with it.

Hi David,

It is recommended to send the updates to the script's maintainer (listed in the 
script's header), too, so that he can quickly incorporate them into his 
development version.

I've recently sent two patches for syntax/vim.vim to Chip Campbell, too; I'm 
including them here again so that they may get some test coverage, too :-)
Dr. Chip, I hope these are still on your TODO list?!

-- regards, ingo

vim-shellcmd.vim.diff adds the highlighting of 'shellcmd' command completion 
method

vim-function-folding.vim.diff fixes folding for:
- functions with global/buffer/window/tabpage/local scope: function b:MyFunc()
- functions with a curly-braces-name: function My{num}Func()
- dictionary function where the dict contains a scope prefix: function 
s:mydict.MyFunc()
- autoload functions in subdirectories (i.e. containing multiple #): function 
foo#bar#MyFunc()

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

--- C:\Program Files\Vim\vim72\syntax\vim.vim   Sat Aug 09 17:32:58 2008
+++ syntax\vim.vim      Wed Feb 04 14:40:53 2009
@@ -157,7 +157,7 @@
 if !exists("g:vimsyn_noerror")
  syn match   vimFunctionError  "\<fu\%[nction]!\=\s\+\zs\U\i\{-}\ze\s*("       
                contains=vimFuncKey,vimFuncBlank nextgroup=vimFuncBody
 endif
-syn match   vimFunction        
"\<fu\%[nction]!\=\s\+\(\(<[sS][iI][dD]>\|[Ss]:\|\u\|\i\+#\)\i*\|\(g:\)\=\(\I\i*\.\)\+\I\i*\)\ze\s*("
   contai...@vimfunclist nextgroup=vimFuncBody
+syn match   vimFunction        
"\<fu\%[nction]!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*("
           contai...@vimfunclist nextgroup=vimFuncBody
 if exists("g:vimsyn_folding") && g:vimsyn_folding =~ 'f'
  syn region  vimFuncBody  contained    fold start="\ze("       
matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\)"             
contai...@vimfuncbodylist
 else                                                                           
                               
--- C:\Program Files\Vim\vim72\syntax\vim.vim   Sat Aug 09 17:32:58 2008
+++ syntax\vim.vim      Wed Feb 04 13:04:09 2009
@@ -197,7 +197,7 @@
 endif
 syn case ignore
 syn keyword vimUserAttrbKey   contained        bar     ban[g]  cou[nt] ra[nge] 
com[plete]      n[args] re[gister]
-syn keyword vimUserAttrbCmplt contained        augroup buffer command dir 
environment event expression file function help highlight mapping menu option 
something tag tag_listfiles var
+syn keyword vimUserAttrbCmplt contained        augroup buffer command dir 
environment event expression file shellcmd function help highlight mapping menu 
option something tag tag_listfiles var
 syn keyword vimUserAttrbCmplt contained        custom customlist 
nextgroup=vimUserAttrbCmpltFunc,vimUserCmdError
 syn match   vimUserAttrbCmpltFunc contained    
",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w*\%(#\u\w*\)\+\|\u\w*\)"hs=s+1 
nextgroup=vimUserCmdError
 

Raspunde prin e-mail lui