subtleGradient / language-javascript-jsx

JavaScript with JSX Bundle for Atom
45 stars 6 forks source link

Strange Alternating Highlighting #19

Open damassi opened 9 years ago

damassi commented 9 years ago

See below:

screen shot 2015-11-10 at 10 38 36 pm
subtleGradient commented 9 years ago

That's strange. What code is above that in your file? What code coloring theme are you using? On Wed, Nov 11, 2015 at 1:39 AM Christopher Pappas notifications@github.com wrote:

See below:

[image: screen shot 2015-11-10 at 10 38 36 pm] https://cloud.githubusercontent.com/assets/236943/11085485/cd72bbe4-87fb-11e5-8948-c41b8a7544e3.png

— Reply to this email directly or view it on GitHub https://github.com/subtleGradient/language-javascript-jsx/issues/19.

adamkdean commented 9 years ago

I get some weird highlighting sometimes as well. Certain keywords remain white while other times they are properly colours. Frustrating, I have to admit.

damassi commented 9 years ago

I'm using Oceanic and the break occurs when i break my component props out onto their own lines.

ryaninvents commented 8 years ago

I'm running into the same issue. I believe (haven't dived into the code yet; this is a total guess) that it's seeing the slash and starting a regex.

screen shot 2016-08-24 at 3 07 22 pm

Here's the code:

import React, { Component, PropTypes } from 'react';

import Foo from '../components/Foo';

export class TypeDropdown extends Component {
    renderBar(bar) {
        return Object.keys(bar).map((k) => (
            <Foo.Bar
              key={k}
              label={bar[k].displayName}
            />
        ));
    }
    render() {
        const { props: { bar = null } } = this;
        if (!bar) {
            return (
                <span>Please wait...</span>
            );
        }
        return <Foo children={this.renderBar(bar)}/>;
    }
}

Changing Foo.Bar to Foo has no effect.

Using Solarized Light syntax theme.

EDIT: documented a further quirk, but it turned out I was using a different syntax highlighter by mistake.