Moved tab component logic to service; handle move session to select next tab

This commit is contained in:
2025-07-02 21:26:24 -05:00
parent 051e42bfa3
commit f94ac677a9
4 changed files with 129 additions and 47 deletions

View File

@@ -77,7 +77,17 @@ export class EditorsComponent {
siblingComponent.assignSession(editorComponent.activeFile);
editorComponent.newSession();
let targetPath = this.tabsService.getRightSiblingTab(
editorComponent.activeFile.path
)
if (targetPath) {
editorComponent.assignSession(
this.filesService.get(targetPath)
);
} else {
editorComponent.newSession();
}
siblingComponent.editor.focus()
} else if (message.action === "move-session-right") {
let editorComponent = this.editorsService.get(message.editorUUID);
@@ -91,7 +101,17 @@ export class EditorsComponent {
siblingComponent.assignSession(editorComponent.activeFile);
editorComponent.newSession();
let targetPath = this.tabsService.getRightSiblingTab(
editorComponent.activeFile.path
)
if (targetPath) {
editorComponent.assignSession(
this.filesService.get(targetPath)
);
} else {
editorComponent.newSession();
}
siblingComponent.editor.focus()
} else if (message.action === "set-active-editor") {
this.editorsService.getActiveEditorComponent().removeActiveStyling();