summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git_commands/file.go
diff options
context:
space:
mode:
authorRyooooooga <eial5q265e5@gmail.com>2022-04-22 21:54:03 +0900
committerRyooooooga <eial5q265e5@gmail.com>2022-04-23 17:39:12 +0900
commite5730cb80bffe835725f94d40e7ea28838f45f91 (patch)
tree762c2c0c83ccfbc36b6891befc9463439aa5e6e6 /pkg/commands/git_commands/file.go
parent8b103b16bd3a06d0e661e507832459fae7ec1198 (diff)
fix: improve default editCommandTemplate
Diffstat (limited to 'pkg/commands/git_commands/file.go')
-rw-r--r--pkg/commands/git_commands/file.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/pkg/commands/git_commands/file.go b/pkg/commands/git_commands/file.go
index 1837ee4a4..898c26e33 100644
--- a/pkg/commands/git_commands/file.go
+++ b/pkg/commands/git_commands/file.go
@@ -5,7 +5,6 @@ import (
"strconv"
"github.com/go-errors/errors"
- "github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/utils"
)
@@ -59,14 +58,16 @@ func (self *FileCommands) GetEditCmdStr(filename string, lineNumber int) (string
}
editCmdTemplate := self.UserConfig.OS.EditCommandTemplate
- if editCmdTemplate == config.DefaultEditCommandTemplate {
+ if len(editCmdTemplate) == 0 {
switch editor {
- case "emacs", "nano", "vi", "vim":
- editCmdTemplate = "{{editor}} +{{line}} {{filename}}"
+ case "emacs", "nano", "vi", "vim", "nvim":
+ editCmdTemplate = "{{editor}} +{{line}} -- {{filename}}"
case "subl":
- editCmdTemplate = "{{editor}} {{filename}}:{{line}}"
+ editCmdTemplate = "{{editor}} -- {{filename}}:{{line}}"
case "code":
- editCmdTemplate = "{{editor}} -r --goto {{filename}}:{{line}}"
+ editCmdTemplate = "{{editor}} -r --goto -- {{filename}}:{{line}}"
+ default:
+ editCmdTemplate = "{{editor}} -- {{filename}}"
}
}
return utils.ResolvePlaceholderString(editCmdTemplate, templateValues), nil