1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Support opening worktree in editor

This commit is contained in:
Jesse Duffield
2023-07-17 15:45:10 +10:00
parent 7b05dacb98
commit 3a7468ecac
6 changed files with 39 additions and 1 deletions

View File

@ -37,6 +37,13 @@ func (self *FilesHelper) EditFileAtLineAndWait(filename string, lineNumber int)
return self.callEditor(cmdStr, true)
}
func (self *FilesHelper) OpenDirInEditor(path string) error {
cmdStr := self.c.Git().File.GetOpenDirInEditorCmdStr(path)
// Not editing in terminal because surely that's not a thing.
return self.callEditor(cmdStr, false)
}
func (self *FilesHelper) callEditor(cmdStr string, editInTerminal bool) error {
if editInTerminal {
return self.c.RunSubprocessAndRefresh(