marshallward / vim-restructuredtext

Syntax file for reStructuredText on Vim.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

c++ vs cpp syntax, non-alphanumeric code names

c0nk opened this issue · comments

commented

The following file is highlighted incorrectly:
https://llvm.org/svn/llvm-project/cfe/trunk/docs/ThreadSanitizer.rst

Starting at the middle of the first code block the document is highlighted pink.

Can you be more specific? Maybe even a screenshot? I can't see anything wrong on my end.

commented

Sorry the version I linked doesn't have the issue. Look at this:
https://llvm.org/svn/llvm-project/cfe/trunk/docs/ThreadSanitizer.rst?p=271997

The immediate issue can be solved by replacing c++ with cpp. (This works for me, at least.) This replaces the broken syntax with vim's C++ (cpp.vim) syntax.

The broader issue is why using c++ broke everything below. Language name is currently restricted to word characters \w = [0-9A-Za-z_], so that probably ought to be fixed.

As for the choice of cpp over c++, it's probably not fair to insist that the file be changed to accommodate vim's preference of cpp over c++, but I can't think of a better solution at the moment. Maybe some sort of aliasing would be good here?

BTW I've changed the issue name to clarify the problem.

I pushed a small changed that replaced with \w with . (wildcard). My reading of the spec says this is probably the more correct interpretation.

I've added it to master, but it would still be good to get feedback from others. (Probably ought to update Bram soon anyway...)

Assuming this is working; closing this issue.