Fixing new file keybinding logic; fixing file selection when only oe remains
This commit is contained in:
parent
d0c73fe4da
commit
5aa6c7ca10
@ -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"},
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user