Skip to content

Commit

Permalink
Merge pull request #544 from brendan0powers/fix_highlighter_exception
Browse files Browse the repository at this point in the history
Handle case where getCursor() returns null in highlighter
  • Loading branch information
krassowski authored Feb 23, 2021
2 parents d86925f + 4893e3e commit 4590114
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/jupyterlab-lsp/src/features/highlights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ export class HighlightsCM extends CodeMirrorIntegration {
return;
}

if (root_position == null) {
this.console.warn('no root position available');
return;
}

const token = this.virtual_editor.get_token_at(root_position);

// if token has not changed, no need to update highlight, unless it is an empty token
Expand Down

0 comments on commit 4590114

Please sign in to comment.