Skip to content
Prev Previous commit
Next Next commit
Better Highlighting for Blocks
  • Loading branch information
riverdusty committed Feb 9, 2017
commit df3669ba7a7f30d8f09f21cc9418c84b455e5c2d
2 changes: 1 addition & 1 deletion mode/smalltalk/smalltalk.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ CodeMirror.defineMode('smalltalk', function(config) {
} else if (/[\w_]/.test(aChar)) {
stream.eatWhile(/[\w\d_]/);
token.name = state.expectVariable ? (keywords.test(stream.current()) ? 'keyword' : 'variable') : null;
token.name = state.expectVariable ? (variables.test(stream.current()) ? 'variable-2' : 'variable') : null;
token.name = state.expectVariable ? (variables.test(stream.current()) ? 'variable-2' : 'variable') : null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you assigning to the same property twice here? This effectively disables the previous statement, which doesn't look like it is right.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could probably be better represented like,
} else if (/[\w_]/.test(aChar)) { stream.eatWhile(/[\w\d_]/); if(keywords.test(stream.current()){ token.name = 'keyword' } else if(variables.test(stream.current){ token.name = 'variable-2' } else { token.name = 'variable' }


} else {
token.eos = state.expectVariable;
Expand Down