mirror of https://github.com/onivim/oni.git
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:
parent
6ecc3f01ff
commit
0b4007fb5a
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue