mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-02-07 13:42:01 +02:00
more explicit
This commit is contained in:
parent
866f4b9f0e
commit
11acac0091
@ -5,6 +5,7 @@ import (
|
||||
"strconv"
|
||||
|
||||
"github.com/go-errors/errors"
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||
)
|
||||
|
||||
@ -58,7 +59,7 @@ func (self *FileCommands) GetEditCmdStr(filename string, lineNumber int) (string
|
||||
}
|
||||
|
||||
editCmdTemplate := self.UserConfig.OS.EditCommandTemplate
|
||||
if editCmdTemplate == "{{editor}} {{filename}}" {
|
||||
if editCmdTemplate == config.DefaultEditCommandTemplate {
|
||||
switch editor {
|
||||
case "emacs", "nano", "vi", "vim":
|
||||
editCmdTemplate = "{{editor}} +{{line}} {{filename}}"
|
||||
|
@ -3,11 +3,13 @@
|
||||
|
||||
package config
|
||||
|
||||
const DefaultEditCommandTemplate = `{{editor}} {{filename}}`
|
||||
|
||||
// GetPlatformDefaultConfig gets the defaults for the platform
|
||||
func GetPlatformDefaultConfig() OSConfig {
|
||||
return OSConfig{
|
||||
EditCommand: ``,
|
||||
EditCommandTemplate: `{{editor}} {{filename}}`,
|
||||
EditCommandTemplate: DefaultEditCommandTemplate,
|
||||
OpenCommand: "open {{filename}}",
|
||||
OpenLinkCommand: "open {{link}}",
|
||||
}
|
||||
|
@ -1,10 +1,12 @@
|
||||
package config
|
||||
|
||||
const DefaultEditCommandTemplate = `{{editor}} {{filename}}`
|
||||
|
||||
// GetPlatformDefaultConfig gets the defaults for the platform
|
||||
func GetPlatformDefaultConfig() OSConfig {
|
||||
return OSConfig{
|
||||
EditCommand: ``,
|
||||
EditCommandTemplate: `{{editor}} {{filename}}`,
|
||||
EditCommandTemplate: DefaultEditCommandTemplate,
|
||||
OpenCommand: `xdg-open {{filename}} >/dev/null`,
|
||||
OpenLinkCommand: `xdg-open {{link}} >/dev/null`,
|
||||
}
|
||||
|
@ -1,10 +1,12 @@
|
||||
package config
|
||||
|
||||
const DefaultEditCommandTemplate = `{{editor}} {{filename}}`
|
||||
|
||||
// GetPlatformDefaultConfig gets the defaults for the platform
|
||||
func GetPlatformDefaultConfig() OSConfig {
|
||||
return OSConfig{
|
||||
EditCommand: ``,
|
||||
EditCommandTemplate: `{{editor}} {{filename}}`,
|
||||
EditCommandTemplate: DefaultEditCommandTemplate,
|
||||
OpenCommand: `start "" {{filename}}`,
|
||||
OpenLinkCommand: `start "" {{link}}`,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user