Feature/fix buffer opening closing (#2644)

* add a quickOpen default mode command and set to edit and fix check against zero in getDefaultOpenMode

* fix typo in comment

* further typo fixes in comment
This commit is contained in:
Akin 2018-11-02 09:39:09 +00:00 committed by GitHub
parent 6ecc3f01ff
commit 0b4007fb5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -149,6 +149,8 @@ const BaseConfiguration: IConfigurationValues = {
"editor.quickOpen.alternativeOpenMode": Oni.FileOpenMode.ExistingTab,
"editor.quickOpen.showHidden": true,
"quickOpen.defaultOpenMode": Oni.FileOpenMode.Edit,
"editor.split.mode": "native",
"editor.typingPrediction": true,

View File

@ -169,6 +169,9 @@ export interface IConfigurationValues {
"editor.quickOpen.alternativeOpenMode": Oni.FileOpenMode
"editor.quickOpen.showHidden": boolean
// this is new command to replace the above legacy editor prefixed command
"quickOpen.defaultOpenMode": Oni.FileOpenMode
"editor.errors.slideOnFocus": boolean
"editor.formatting.formatOnSwitchToNormalMode": boolean // TODO: Make this setting reliable. If formatting is slow, it will hose edits... not fun

View File

@ -343,13 +343,18 @@ export class QuickOpen {
private getDefaultOpenMode(): Oni.FileOpenMode {
const legacy = this._oni.configuration.getValue("editor.quickOpen.defaultOpenMode", null)
if (legacy) {
// the value of the defaultOpenMode is a numerical enum that includes 0 so we check that the value
// is a number and that number is an option in the file open mode enum
if (!isNaN(legacy) && legacy in Oni.FileOpenMode) {
return legacy
}
return this._oni.configuration.getValue(
const defaultOpenMode = this._oni.configuration.getValue(
"quickOpen.defaultOpenMode",
Oni.FileOpenMode.NewTab,
)
return defaultOpenMode
}
private isInstallDirectoryOrHome() {