退出时保存光标位置

This commit is contained in:
fofolee
2022-04-13 16:49:47 +08:00
parent 8f479fa545
commit d659fdcc88
10 changed files with 27 additions and 23 deletions

View File

@@ -176,6 +176,13 @@ export default {
setEditorLanguage(language) {
monaco.editor.setModelLanguage(this.rawEditor.getModel(), language);
},
getCursorPosition() {
return this.rawEditor.getPosition();
},
setCursorPosition(pos) {
if (!pos) return;
this.rawEditor.setPosition(pos);
},
repacleEditorSelection(text) {
var selection = this.rawEditor.getSelection();
var range = new monaco.Range(