Skip to content

Commit

Permalink
Handle case where getCursor() returns null in highlighter
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan0powers committed Feb 23, 2021
1 parent d86925f commit 0c3b188
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) {
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 0c3b188

Please sign in to comment.