On Fri, 20 Aug 2010, Charles Campbell wrote:

> Hello,
> 
> I was trying out ownsyntax; I may have found a problem.  Using misc1.c 
> from vim's source code:
> 
> vim -u NONE -N misc1.c
> :syn on
> :vsplit
> :ownsyntax tex
> 
> The underscores get highlighted with Error highlighting in the left 
> (ownsyntax tex) window; this is expected.
> 
> However, look at the static char_u ... [char] is now highlighted 
> differently than before.  Putting the cursor in that window and typing 
> ":ownsyntax c" doesn't fix things, either.  Neither does quitting the 
> "ownsyntax tex" window.
> 
> By the way, I know that viewing C source code as LaTeX source doesn't 
> make sense :)

It seems to be related to just having two syntax items (in different 
syntaxes) with the same name, but different highlighting links.

==> ~/.vim.local/syntax/aaa.vim <==
syn match Foo /ab/
hi link Foo Comment

==> ~/.vim.local/syntax/bbb.vim <==
syn match Foo /cd/
hi link Foo Constant

==> /tmp/foo <==
abcd
sub foo { print "lalalaperl\n"; }
int main(void) { return 42; }

$ vi -u NONE -N /tmp/foo
:syn on
:setf aaa
:vs
:ownsyntax bbb

After the :setf aaa, the 'ab' is highlighted as Comment.  As expected.  
Same goes for the 'ab' on the right side after the :vs.  But, after the 
:ownsyntax bbb, both the right-side 'ab' and the left-side 'cd' are 
highlighted as Constant.

-- 
Best,
Ben

(This particular example was much weirder when I had named the syntax 
files a.vim and b.vim, not knowing that Vim comes with a syntax file for 
the 'B' language.)

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui