Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Avoid error calling buildHighlightIterator on a destroyed language mode
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbrunsfeld committed Aug 22, 2018
1 parent 9073103 commit 02aa599
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/tree-sitter-language-mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class TreeSitterLanguageMode {
*/

buildHighlightIterator () {
if (!this.rootLanguageLayer) return new NullHighlightIterator()
const layerIterators = [
this.rootLanguageLayer.buildHighlightIterator(),
...this.injectionsMarkerLayer.getMarkers().map(m => m.languageLayer.buildHighlightIterator())
Expand Down

0 comments on commit 02aa599

Please sign in to comment.