diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2023-07-17 15:45:10 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2023-07-30 18:35:23 +1000 |
commit | 3a7468ecac9992e56649543fd2ca934dc71dbc41 (patch) | |
tree | f0025ebb2714cfe4ba03bd2eb3f68fcaa81bbe12 /pkg/commands/git_commands/file.go | |
parent | 7b05dacb98b1baa72f61e7decf7d23e8bd241393 (diff) |
Support opening worktree in editor
Diffstat (limited to 'pkg/commands/git_commands/file.go')
-rw-r--r-- | pkg/commands/git_commands/file.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/commands/git_commands/file.go b/pkg/commands/git_commands/file.go index 6c90b91f2..7efdb567a 100644 --- a/pkg/commands/git_commands/file.go +++ b/pkg/commands/git_commands/file.go @@ -131,6 +131,17 @@ func (self *FileCommands) GetEditAtLineAndWaitCmdStr(filename string, lineNumber return cmdStr } +func (self *FileCommands) GetOpenDirInEditorCmdStr(path string) string { + template := config.GetOpenDirInEditorTemplate(&self.UserConfig.OS, self.guessDefaultEditor) + + templateValues := map[string]string{ + "dir": self.cmd.Quote(path), + } + + cmdStr := utils.ResolvePlaceholderString(template, templateValues) + return cmdStr +} + func (self *FileCommands) guessDefaultEditor() string { // Try to query a few places where editors get configured editor := self.config.GetCoreEditor() |