Compare commits

..

No commits in common. "ab73f22dc5bcbe34399e12d72638f892aba83111" and "954827a0d6fd620b4b069c597d9d2ff74f914639" have entirely different histories.

3 changed files with 2 additions and 11 deletions

View File

@ -210,13 +210,10 @@ export class OpenFile implements WorkspaceFile {
private changeSet: ChangeSet; private changeSet: ChangeSet;
get changes(): ChangeSet { get changes(): ChangeSet {
if (!this.changeSet) { if (!this.changeSet) {
this.clearChanges(); this.changeSet = ChangeSet.empty(this.rootState.val.doc.length);
} }
return this.changeSet; return this.changeSet;
} }
clearChanges(): void {
this.changeSet = ChangeSet.empty(this.rootState.val.doc.length);
}
// Return an EditorView to be used by the LSP Workspace for position mapping. // Return an EditorView to be used by the LSP Workspace for position mapping.
// If `main` is provided and belongs to this open file, return it. Otherwise // If `main` is provided and belongs to this open file, return it. Otherwise

View File

@ -8,12 +8,6 @@ import * as u from "./utils";
const folderTreeState = van.state<FolderTree | null>(null); const folderTreeState = van.state<FolderTree | null>(null);
van.derive(() => {
if (folderTreeState.val) {
document.title = folderTreeState.val.path + " - Miller code editor";
}
});
async function openFolder() { async function openFolder() {
const folderTree = await window.electronAPI.openFolder().catch(alert); const folderTree = await window.electronAPI.openFolder().catch(alert);
if (!folderTree) return; if (!folderTree) return;

View File

@ -109,7 +109,7 @@ class OpenFileWorkspace extends Workspace {
result.push({ file, prevDoc, changes }); result.push({ file, prevDoc, changes });
file.doc = file.rootState.val.doc; file.doc = file.rootState.val.doc;
file.version = this.nextFileVersion(file.uri); file.version = this.nextFileVersion(file.uri);
file.clearChanges(); file.changes = ChangeSet.empty(file.doc.length);
} }
for (const e of file.editors) { for (const e of file.editors) {
const plugin = LSPPlugin.get(e.view); const plugin = LSPPlugin.get(e.view);