Skip to content

Commit

Permalink
fix(autoindent) fix(grammar) atom wants "" to be whitespace for its a…
Browse files Browse the repository at this point in the history
…utoindent logic to work

closes #159
  • Loading branch information
basarat committed Mar 6, 2015
1 parent 8a6c65a commit 9b9862d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/main/atom/typescriptGrammar.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/main/atom/typescriptGrammar.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/main/atom/typescriptGrammar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ export class TypeScriptSemanticGrammar extends AtomTSBaseGrammar {
var ruleStack = [output.finalLexState];

var classificationResults = output.entries;
// TypeScript classifier returns empty for "". But Atom wants to have some Token
if (!classificationResults.length) return { tokens: [{ style: '', str: '' }], ruleStack: ruleStack };
// TypeScript classifier returns empty for "". But Atom wants to have some Token and it needs to be "whitespace" for autoindent to work
if (!classificationResults.length) return { tokens: [{ style: 'whitespace', str: '' }], ruleStack: ruleStack };

// Start with trailing whitespace taken into account.
// This is needed because classification for that is already done by ATOM internally (somehow)
Expand Down

0 comments on commit 9b9862d

Please sign in to comment.