mxw / vim-jsx

React JSX syntax highlighting and indenting for vim.
1.59k stars 95 forks source link

Possible highlighting issue #28

Closed joshacheson closed 9 years ago

joshacheson commented 9 years ago

Hi there. I've installed this plugin and also its dependency via vundle. In some cases it seems to work just fine but I'm curious about two things.

1) In this case, would it be expected that the closing div is highlighted in a different color than the opening div?

screen shot 2015-02-05 at 12 04 36 pm

2) If I add an opening quote to the content of my element, highlighting seems to go awry.

screen shot 2015-02-05 at 12 05 41 pm

I can't be 100% sure if this is just an issue of improper installation or if these are features/problems inherent to this plugin.

joshacheson commented 9 years ago

Note: After changing my color scheme in VIM, i'm finding that my first point was just a problem with my colorscheme. For what ever reason tomorrow night doesn't handle jsx so well.

The other issue, regarding open quotes, exists with each color scheme I try though.

mxw commented 9 years ago

Yeah, I see this also. It might be a wontfix, though—The xmlRegion needs to support embedding jsStrings because you're allowed to have bare strings as children (and bare words just get picked up as strings stripped of leading/trailing whitespace, IIRC). The XML syntax package doesn't have a syntax class for bare words; it's just "nothing", so it's hard to prevent the matchers from picking up strings that start in the middle of such an extent.

If I come up with a solution, I'll commit it, but otherwise, you can always work around this by just quoting your string.

milieu commented 9 years ago

Also have the open quote problem, and I installed via Vundle too. The closing div highlight is not a problem for me.

Using the vim-colors-solarized plugin as my color scheme.

mxw commented 9 years ago

Not workin' on this presently. If you come up with something, let's talk pull requests. Hopefully the double-quoting workaround isn't too bad.