Reverting method name to newSession

This commit is contained in:
itdominator 2025-06-21 16:28:41 -05:00
parent 598a66f517
commit 52a3785168
2 changed files with 8 additions and 11 deletions

View File

@ -87,7 +87,7 @@ export class EditorsComponent {
siblingComponent.editor.setSession(session);
siblingComponent.activeFile = editorComponent.activeFile;
editorComponent.newBuffer();
editorComponent.newSession();
siblingComponent.editor.focus()
} else if (message.action === "move-session-right") {
let editorComponent = this.editorsService.get(message.editorUUID);
@ -102,7 +102,7 @@ export class EditorsComponent {
siblingComponent.editor.setSession(session);
siblingComponent.activeFile = editorComponent.activeFile;
editorComponent.newBuffer();
editorComponent.newSession();
siblingComponent.editor.focus()
} else if (message.action === "set-active-editor") {
this.editorsService.get(this.activeEditor).removeActiveStyling();
@ -122,7 +122,7 @@ export class EditorsComponent {
for (let i = 0; i < editors.length; i++) {
let editorComponent = editors[i].instance;
if (editorComponent.editor.session == file.session) {
editorComponent.newBuffer();
editorComponent.newSession();
}
}

View File

@ -131,11 +131,10 @@ export class NewtonEditorComponent extends NewtonEditorBase {
}
public newBuffer() {
let buffer = ace.createEditSession([""]);
this.editor.setSession(buffer);
public newSession() {
this.activeFile = null;
this.updateInfoBar();
let session = ace.createEditSession([""]);
this.editor.setSession(session);
}
protected openFiles() {
@ -163,11 +162,9 @@ export class NewtonEditorComponent extends NewtonEditorBase {
window.fs.saveFileAs().then((path: string) => {
if (!path) return;
let file: NewtonFile = new File([""], path, {
type: "text/plain",
});
let file: NewtonFile = new File([""], path, {});
const text = this.editor.session.getValue();
window.fs.saveFile(path, text);
this.filesService.addFile(
path,