atom / one-dark-syntax

Atom One dark syntax theme

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Operators aren't highlighted

Victorystick opened this issue · comments

Currently operators like +,!==, ||, typeof and new aren't highlighted in JavaScript.

screen shot 2015-09-07 at 16 22 56

Is this intended behaviour?

Operators are highlighted:

https://github.com/atom/one-dark-syntax/blob/master/styles/language.less#L26-L28

But they are colored the same as default text:

https://github.com/atom/one-dark-syntax/blob/master/styles/colors.less#L13-L14

I can't speak as to whether it is intended behavior or not.

Is this intended behaviour?

Yes, that's intended. Well, this theme is based on base16-tomorrow where the same question came up: atom/base16-tomorrow-dark-theme#13

I think there it should stay true to the original theme and not have a different color for operators. Just because the name makes people expect it to be the same.

Now if One dark should start "its own life" is another question.

Now if One dark should start "its own life" is another question.

'course it should—it's the default theme for a rather popular text editor, unlike Tomorrow Dark :-]

So this question came up again in atom/language-javascript#273 and atom/language-javascript#274.

Here the before/after if operators have the same color as other keywords:

function add ( x, y ) {
  if ( typeof x != 'number' || typeof y !== 'number') {
    throw new TypeError('Can only add numbers!');
  }

  return x + y;
}

function destoryCompleted() {
  for (var id in _todos) {

var a = {};
a.foo = 'bar';
delete a.foo;

Before:

screen shot 2015-12-06 at 2 20 22 pm

After:

screen shot 2015-12-06 at 2 03 25 pm

Hmm.. I usually prefer not to colorize too much just so that not everything asks for attention.

Anyone strongly thinks it should be the new default? Here you can try it out how it feels in styles.less with One dark:

.theme-one-dark-syntax atom-text-editor::shadow {
  .keyword.operator.js {
    color: #c678dd;
  }
}