diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2023-03-28 18:00:40 +0200 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2023-04-13 13:14:00 +0200 |
commit | e4e16fa38ea5d89fb139c5153338e32d1eeafede (patch) | |
tree | 800d63b724b82a5c8dc5d9de6021a5e46306ebfc /pkg/config | |
parent | b7e029adc7c5cf27ae2c5db768b971a959fa2449 (diff) |
Change OpenCommand to Open and OpenLinkCommand to OpenLink
We do this for consistency with the edit settings. The old names are kept as a
fallback for now.
Diffstat (limited to 'pkg/config')
-rw-r--r-- | pkg/config/config_default_platform.go | 4 | ||||
-rw-r--r-- | pkg/config/config_linux.go | 8 | ||||
-rw-r--r-- | pkg/config/config_windows.go | 4 | ||||
-rw-r--r-- | pkg/config/user_config.go | 9 |
4 files changed, 17 insertions, 8 deletions
diff --git a/pkg/config/config_default_platform.go b/pkg/config/config_default_platform.go index 1a66f9d9e..d05201454 100644 --- a/pkg/config/config_default_platform.go +++ b/pkg/config/config_default_platform.go @@ -6,7 +6,7 @@ package config // GetPlatformDefaultConfig gets the defaults for the platform func GetPlatformDefaultConfig() OSConfig { return OSConfig{ - OpenCommand: "open -- {{filename}}", - OpenLinkCommand: "open {{link}}", + Open: "open -- {{filename}}", + OpenLink: "open {{link}}", } } diff --git a/pkg/config/config_linux.go b/pkg/config/config_linux.go index 3ed29ca6e..7f6187ee3 100644 --- a/pkg/config/config_linux.go +++ b/pkg/config/config_linux.go @@ -29,13 +29,13 @@ func isContainer() bool { func GetPlatformDefaultConfig() OSConfig { if isWSL() && !isContainer() { return OSConfig{ - OpenCommand: `powershell.exe start explorer.exe {{filename}} >/dev/null`, - OpenLinkCommand: `powershell.exe start {{link}} >/dev/null`, + Open: `powershell.exe start explorer.exe {{filename}} >/dev/null`, + OpenLink: `powershell.exe start {{link}} >/dev/null`, } } return OSConfig{ - OpenCommand: `xdg-open {{filename}} >/dev/null`, - OpenLinkCommand: `xdg-open {{link}} >/dev/null`, + Open: `xdg-open {{filename}} >/dev/null`, + OpenLink: `xdg-open {{link}} >/dev/null`, } } diff --git a/pkg/config/config_windows.go b/pkg/config/config_windows.go index 21663c163..96a810b50 100644 --- a/pkg/config/config_windows.go +++ b/pkg/config/config_windows.go @@ -3,7 +3,7 @@ package config // GetPlatformDefaultConfig gets the defaults for the platform func GetPlatformDefaultConfig() OSConfig { return OSConfig{ - OpenCommand: `start "" {{filename}}`, - OpenLinkCommand: `start "" {{link}}`, + Open: `start "" {{filename}}`, + OpenLink: `start "" {{link}}`, } } diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go index 0c227899e..fb0638e43 100644 --- a/pkg/config/user_config.go +++ b/pkg/config/user_config.go @@ -311,6 +311,13 @@ type OSConfig struct { // are defined in the getPreset function in editor_presets.go. EditPreset string `yaml:"editPreset,omitempty"` + // Command for opening a file, as if the file is double-clicked. Should + // contain "{{filename}}", but doesn't support "{{line}}". + Open string `yaml:"open,omitempty"` + + // Command for opening a link. Should contain "{{link}}". + OpenLink string `yaml:"openLink,omitempty"` + // -------- // The following configs are all deprecated and kept for backward @@ -327,9 +334,11 @@ type OSConfig struct { EditCommandTemplate string `yaml:"editCommandTemplate,omitempty"` // OpenCommand is the command for opening a file + // Deprecated: use Open instead. OpenCommand string `yaml:"openCommand,omitempty"` // OpenLinkCommand is the command for opening a link + // Deprecated: use OpenLink instead. OpenLinkCommand string `yaml:"openLinkCommand,omitempty"` } |