|
@@ -9,21 +9,17 @@ import {
|
|
|
} from '@jupyterlab/services';
|
|
|
|
|
|
import {
|
|
|
- ArrayExt.findFirstIndex
|
|
|
-} from 'phosphor/lib/algorithm/searching';
|
|
|
+ ArrayExt
|
|
|
+} from '@phosphor/algorithm';
|
|
|
|
|
|
import {
|
|
|
IDisposable, DisposableDelegate
|
|
|
} from '@phosphor/disposable';
|
|
|
|
|
|
import {
|
|
|
- Signal.clearData, defineSignal, ISignal
|
|
|
+ ISignal, Signal
|
|
|
} from '@phosphor/signaling';
|
|
|
|
|
|
-import {
|
|
|
- Vector
|
|
|
-} from 'phosphor/lib/collections/vector';
|
|
|
-
|
|
|
import {
|
|
|
CodeEditor
|
|
|
} from '../codeeditor';
|
|
@@ -117,7 +113,7 @@ class CodeMirrorEditor implements CodeEditor.IEditor {
|
|
|
/**
|
|
|
* A signal emitted when either the top or bottom edge is requested.
|
|
|
*/
|
|
|
- readonly edgeRequested: ISignal<this, CodeEditor.EdgeLocation>;
|
|
|
+ readonly edgeRequested = new Signal<this, CodeEditor.EdgeLocation>(this);
|
|
|
|
|
|
/**
|
|
|
* The DOM node that hosts the editor.
|
|
@@ -237,7 +233,7 @@ class CodeMirrorEditor implements CodeEditor.IEditor {
|
|
|
}
|
|
|
this._editor = null;
|
|
|
this._model = null;
|
|
|
- this._keydownHandlers.clear();
|
|
|
+ this._keydownHandlers.length = 0;
|
|
|
Signal.clearData(this);
|
|
|
}
|
|
|
|
|
@@ -316,9 +312,9 @@ class CodeMirrorEditor implements CodeEditor.IEditor {
|
|
|
* @returns A disposable that can be used to remove the handler.
|
|
|
*/
|
|
|
addKeydownHandler(handler: CodeEditor.KeydownHandler): IDisposable {
|
|
|
- this._keydownHandlers.pushBack(handler);
|
|
|
+ this._keydownHandlers.push(handler);
|
|
|
return new DisposableDelegate(() => {
|
|
|
- this._keydownHandlers.remove(handler);
|
|
|
+ ArrayExt.removeAllWhere(this._keydownHandlers, val => val === handler);
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -631,7 +627,7 @@ class CodeMirrorEditor implements CodeEditor.IEditor {
|
|
|
private _model: CodeEditor.IModel;
|
|
|
private _editor: CodeMirror.Editor;
|
|
|
protected selectionMarkers: { [key: string]: CodeMirror.TextMarker[] | undefined } = {};
|
|
|
- private _keydownHandlers = new Vector<CodeEditor.KeydownHandler>();
|
|
|
+ private _keydownHandlers = new Array<CodeEditor.KeydownHandler>();
|
|
|
private _changeGuard = false;
|
|
|
private _selectionStyle: CodeEditor.ISelectionStyle;
|
|
|
private _uuid = '';
|
|
@@ -651,10 +647,6 @@ namespace CodeMirrorEditor {
|
|
|
}
|
|
|
|
|
|
|
|
|
-// Define the signals for the `CodeMirrorEditor` class.
|
|
|
-defineSignal(CodeMirrorEditor.prototype, 'edgeRequested');
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* The namespace for module private data.
|
|
|
*/
|