Update close file logic to select prior if exists; bug fix in LSP regarding editor and assignment

This commit is contained in:
2025-07-15 19:46:17 -05:00
parent ae60905eb4
commit d6f766753c
4 changed files with 34 additions and 10 deletions

View File

@@ -131,16 +131,26 @@ export class EditorsComponent {
for (let i = 0; i < editors.length; i++) {
let editorComponent = editors[i];
if (editorComponent.editor.session == file.session) {
if (editorComponent.editor.session !== file.session) continue;
let targetFile = this.filesService.getPreviousFile(file.path)
if (targetFile) {
editorComponent.assignSession(targetFile);
if (activeComponent == editorComponent) {
this.editorsService.miniMapView.cloneSession(targetFile);
}
} else {
editorComponent.newFile();
if (activeComponent == editorComponent) {
this.editorsService.miniMapView.newFile();
}
editorComponent.newFile();
}
}
activeComponent.lspManagerService.closeDocument(file.session);
this.filesService.delete(file);
this.filesService.unset(file);
}
});