mirror of
https://github.com/convergencelabs/monaco-collab-ext.git
synced 2024-10-27 20:34:17 +00:00
Update to work with latest monaco
This commit is contained in:
parent
6a17b25fcc
commit
3e0008ed78
@ -12,6 +12,21 @@ import {EditorContentManager} from "./EditorContentManager";
|
|||||||
import {OnDisposed} from "./OnDisposed";
|
import {OnDisposed} from "./OnDisposed";
|
||||||
import {Validation} from "./Validation";
|
import {Validation} from "./Validation";
|
||||||
|
|
||||||
|
interface Configuration {
|
||||||
|
readonly lineHeight: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getConfiguration(editorInstance: editor.ICodeEditor): Configuration {
|
||||||
|
// Support for Monaco < 0.19.0
|
||||||
|
if (typeof (editorInstance as any).getConfiguration === 'function') {
|
||||||
|
return (editorInstance as any).getConfiguration()
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
lineHeight: editorInstance.getOption(editor.EditorOption.lineHeight)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class implements a Monaco Content Widget to render a remote user's
|
* This class implements a Monaco Content Widget to render a remote user's
|
||||||
* cursor, and an optional tooltip.
|
* cursor, and an optional tooltip.
|
||||||
@ -47,7 +62,7 @@ export class RemoteCursorWidget implements editor.IContentWidget, IDisposable {
|
|||||||
this._onDisposed = onDisposed;
|
this._onDisposed = onDisposed;
|
||||||
|
|
||||||
// Create the main node for the cursor element.
|
// Create the main node for the cursor element.
|
||||||
const {lineHeight} = this._editor.getConfiguration();
|
const {lineHeight} = getConfiguration(this._editor);
|
||||||
this._domNode = document.createElement("div");
|
this._domNode = document.createElement("div");
|
||||||
this._domNode.className = "monaco-remote-cursor";
|
this._domNode.className = "monaco-remote-cursor";
|
||||||
this._domNode.style.background = color;
|
this._domNode.style.background = color;
|
||||||
|
Loading…
Reference in New Issue
Block a user