Skip to content

Commit 90778b1

Browse files
committed
Put the callback back into connector, no need to assign
1 parent 61e906a commit 90778b1

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

packages/jupyterlab-lsp/src/virtual/codemirror_editor.ts

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -519,21 +519,18 @@ export class CodeMirrorVirtualEditor
519519
callback(cm_editor);
520520
}
521521
if (monitor_for_new_blocks) {
522-
let activation_callback = (
523-
adapter: WidgetAdapter<IDocumentWidget>,
524-
data: IEditorChangedData
525-
) => {
526-
let { editor } = data;
527-
if (editor == null) {
528-
return;
529-
}
530-
let cm_editor = (editor as CodeMirrorEditor).editor;
531-
if (!editors_with_handlers.has(cm_editor)) {
532-
callback(cm_editor);
522+
this.adapter.editorAdded.connect(
523+
(adapter: WidgetAdapter<IDocumentWidget>, data: IEditorChangedData) => {
524+
let { editor } = data;
525+
if (editor == null) {
526+
return;
527+
}
528+
let cm_editor = (editor as CodeMirrorEditor).editor;
529+
if (!editors_with_handlers.has(cm_editor)) {
530+
callback(cm_editor);
531+
}
533532
}
534-
};
535-
536-
this.adapter.editorAdded.connect(activation_callback);
533+
);
537534
this.adapter.editorRemoved.connect(
538535
(adapter, data: IEditorChangedData) => {
539536
let { editor } = data;

0 commit comments

Comments
 (0)