Hello, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> * On Thu, Jun 29, 2006 at 08:19:48PM +0300, Yakov Lerner <[EMAIL PROTECTED]> > wrote: > > I had similar problem, namely that syn-keyword > > (like static etc) prevent syn-match from matching > > the keywords. The detailed explanation and > > hint at possible solition is at: > > > > http://marc.theaimsgroup.com/?l=vim&m=114321198924381&w=2 > > http://marc.theaimsgroup.com/?l=vim&m=114322806510413&w=2 > > http://marc.theaimsgroup.com/?l=vim&m=114323035711653&w=2 > > > > I don't know how to make syn-match to match keywords. > > I proposed once to add explicit 'priority=N' attribute to syntax rules > > to make it possible. > > Thank you for the pointers Yakov. I'll have a look at them. Finally I had a look at your pointers. It seems quite complex as we have to: - either hack in the standard syntax files - or do a :syn-clear to re-submit the cleared syntax items that must be accepted in the :syn-match. By the time I implement it, I have found another workaround: I absorb the keyword I had troubles with in the leading context (thanks to \(regex\)\@<=). Now I have only one remaining little issue to not highlight "catch ([[:space:]] const foo<cursor>)" For those interrested, my definitions are: syn match cppBadCatch \ /\(catch\s*(\s*\(const\)\=\)\@<=\(\s*\.\.\.\s*\)[EMAIL PROTECTED]&)]*\()\)[EMAIL PROTECTED]/ \ contains=cStorageClass syn match cppEditedCatch \ /\(catch\s*(\)\@<=\s*[a-zA-Z:_]\+\s*\(\%[const]\|const\s*\)\=\%#\(\s*)\)[EMAIL PROTECTED]/ \ contains=cStorageClass syn match cppEditedCatch \ /\(catch\s*(\s*const\)\@<=\s*[a-zA-Z:_]*\s*\%#\(\s*)\)[EMAIL PROTECTED]/ \ contains=cStorageClass hi def link cppBadCatch SpellBad hi def link cppEditedCatch SpellRare " debugging purpose BTW, is there a way to add a syntax decoration to the current highlighting ? i.e. I'd like to have "const" in Statement (as by default), but curly-underlined ; types like std::string also highlighted as usual but curly-underlined, ... In other words, in there a way to emulate the highlighting policy of vim7 spellchecker that adds the curly underline to the current highlighting ? -- Luc Hermitte
