Fixing new file keybinding logic; fixing file selection when only oe remains

This commit is contained in:
itdominator 2025-07-03 10:22:53 -05:00
parent d0c73fe4da
commit 5aa6c7ca10
3 changed files with 13 additions and 4 deletions

View File

@ -39,7 +39,8 @@ export const Keybindings: Array<{}> = [
}, {
name: "newFile",
bindKey: {win: "ctrl-t", mac: "ctrl-t"},
readOnly: true
service: "editorsService",
readOnly: false
}, {
name: "openFiles",
bindKey: {win: "ctrl-o", mac: "ctrl-o"},

View File

@ -71,6 +71,13 @@ export class EditorsService {
this.miniMapView.cloneSession(file);
}
public newFile() {
let editorComponent = this.getActiveEditorComponent();
editorComponent.newFile();
this.miniMapView.newFile();
}
public getSession() {
let editorComponent = this.get(this.activeEditor);
let editor = editorComponent.editor;

View File

@ -132,7 +132,7 @@ export class CodeViewBase {
return result;
},
onAccept: (data) => {
let fpath = data.value;
let fpath = (data.value) ? data.value : data.item;
let path = "";
for (let i = 0; i < stubPaths.length; i++) {
@ -143,8 +143,9 @@ export class CodeViewBase {
if (!path) return;
this.activeFile = this.filesService.get(path);
this.editor.setSession(this.activeFile.session);
this.editorsService.setSession(
this.filesService.get(path)
);
}
});