marshallward / vim-restructuredtext

Syntax file for reStructuredText on Vim.
26 stars 12 forks source link

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

Closed c0nk closed 7 years ago

c0nk commented 7 years ago

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.

marshallward commented 7 years ago

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

c0nk commented 7 years ago

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

marshallward commented 7 years ago

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?

marshallward commented 7 years ago

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

marshallward commented 7 years ago

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...)

marshallward commented 7 years ago

Assuming this is working; closing this issue.