mirror of
https://github.com/convergencelabs/monaco-collab-ext.git
synced 2024-10-27 20:34:17 +00:00
Merge pull request #4 from CGNonofr/monaco-19
Update to work with latest monaco
This commit is contained in:
commit
705b55b117
2577
package-lock.json
generated
2577
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -30,7 +30,7 @@
|
|||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"monaco-editor": "^0.15.6"
|
"monaco-editor": ">=0.15.6 <=0.20.x"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "7.2.3",
|
"@babel/cli": "7.2.3",
|
||||||
|
@ -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