--- Ilya Bobir <[EMAIL PROTECTED]> wrote: > Peter Hodge wrote: > > Hello, > > > > I have discovered that it is possible for a syntax region to overlap a > syntax > > keyword, even though the region is not contained in the keyword. Take the > > following code example and apply the syntax commands below: > > > > TEST CODE: > > > > (is_array($foo)) > > ( is_array($foo) ) > > > > SYNTAX COMMANDS: > > > > syntax keyword Function is_array > > syntax region r1 matchgroup=Typedef start=/array(/ end=/)/ keepend > extend > > > > Now what is even more odd, if I add another region for the ( and ) arround > the > > test code, the overlap doesn't happen in the first example: > > > > syntax region r2 matchgroup=Delimiter start=/(/ end=/)/ keepend extend > > contains=ALL > > > > What is going on here? > > > > regards, > > Peter > > > I do not see anything special. For me r1 does not contribute to > highlighting at all, and r2 cause parenthesis to be highlighted. > > I have VIM - Vi IMproved 7.0 (2006 May 7, compiled Sep 22 2006 22:03:35) > MS-Windows 32 bit GUI version with OLE support > Included patches: 1-109 > > Also with changes from patch 117.
Thanks for your help, I had another look and found out you need another syntax command to reproduce it properly. Here is the revised bug report Start vim using vim -u NONE insert the following test code (note that the 4th line must be indented). array($foo) is_array $foo is_array($foo) is_array($foo) Apply the following syntax commands: syn on syn keyword Function is_array syn region r1 matchgroup=Type start=/array(/ end=/)/ syn keyword Error foo containedin=NOTHING You will find that the keyword is_array and region r1 are confused over how to highlight is_array(...) when it doesn't start at the beginning of the line, and it has something to do with the 'foo' keyword having a 'containedin=' option. regards, Peter ____________________________________________________ On Yahoo!7 Break a world record with Total Girl's Worlds Largest Slumber Party http://www.totalgirl.com.au/slumberparty