Skip to content

Commit b7cd57e

Browse files
authored
Merge pull request #361 from krassowski/fix-syntax-updates
Fix performance issues caused by lazy syntax highlight implementation
2 parents e391dd2 + 06b068e commit b7cd57e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
## CHANGELOG
22

3+
### `@krassowski/jupyterlab-lsp 2.0.6` (unreleased)
4+
5+
- bug fixes
6+
7+
- fix syntax highlighting of %%language cells slowing down editing in notebooks ([#361])
8+
9+
[#361]: https://github.com/krassowski/jupyterlab-lsp/issues/361
10+
311
### `@krassowski/jupyterlab-lsp 2.0.5` (2020-09-11)
412

513
- bug fixes

packages/jupyterlab-lsp/src/features/syntax_highlighting.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ export class CMSyntaxHighlighting extends CodeMirrorIntegration {
7575

7676
// change the mode if the majority of the code is the foreign code
7777
if (coverage > this.settings.composite.foreignCodeThreshold) {
78-
editor.setOption('mode', mode.mime);
78+
let old_mode = editor.getOption('mode');
79+
if (old_mode != mode.mime) {
80+
editor.setOption('mode', mode.mime);
81+
}
7982
}
8083
}
8184
}

0 commit comments

Comments
 (0)