On Sun, Nov 23, 2008 at 05:56:41PM +0100, François Ingelrest wrote:
>
> Hi all,
>
> No news on this issue?
>
> On Wed, Nov 5, 2008 at 17:10, François Ingelrest
> <[EMAIL PROTECTED]> wrote:
> > Hi all,
> >
> > If I put this in a foo.vim file:
> >
> > ----
> > highlight Comment guifg=White guibg=Black
> >
> > function! Foo()
> >
> > highlight Comment guifg=White guibg=Black
> >
> > endfunction
> > ----
> >
> > The first "highlight" line is highlighted, but not the second one. It
> > seems that's because it's inside a function. Is it intended, or is
> > this a bug in the vim syntax file?
>
> >
After looking at syntax/vim.vim, I noticed that the syntax cluster
that defines what's allowed within a function body didn't include the
syntax item for highlights. Neither did it include the syntax item for
abbreviations. I added those lines, and re-set the 'filetype' option,
and sure enough, the highlight and abbrev keywords were highlighted.
For all I know, there are other Vim script elements that aren't being
highlighted as well.
Offhand, I'd say that this is merely an oversight. Dr. Chip, would
you care to weigh in on this?
I've attached the patch with the aforementioned changes.
--
Erik Falor
Registered Linux User #445632 http://counter.li.org
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
*** vim.vim Tue Aug 19 07:48:28 2008
--- vim.vim.new Mon Nov 24 13:07:02 2008
***************
*** 153,159 ****
" Functions : Tag is provided for those who wish to highlight tagged
functions {{{2
" =========
syn cluster vimFuncList contains=vimCommand,vimFuncKey,Tag,vimFuncSID
! syn cluster vimFuncBodyList
contains=vimAddress,vimAutoCmd,vimCmplxRepeat,vimComment,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIf,vimFunc,vimFunction,vimFunctionError,vimFuncVar,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUserCommand
if !exists("g:vimsyn_noerror")
syn match vimFunctionError "\<fu\%[nction]!\=\s\+\zs\U\i\{-}\ze\s*("
contains=vimFuncKey,vimFuncBlank nextgroup=vimFuncBody
endif
--- 153,159 ----
" Functions : Tag is provided for those who wish to highlight tagged
functions {{{2
" =========
syn cluster vimFuncList contains=vimCommand,vimFuncKey,Tag,vimFuncSID
! syn cluster vimFuncBodyList
contains=vimAddress,vimAutoCmd,vimCmplxRepeat,vimComment,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIf,vimFunc,vimFunction,vimFunctionError,vimFuncVar,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUserCommand,vimHighlight,vimAbb
if !exists("g:vimsyn_noerror")
syn match vimFunctionError "\<fu\%[nction]!\=\s\+\zs\U\i\{-}\ze\s*("
contains=vimFuncKey,vimFuncBlank nextgroup=vimFuncBody
endif