diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-26 17:15:13 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-09-27 09:49:30 +1000 |
commit | da8eac5538b236e4b79e3bab6465e8d5666c48e0 (patch) | |
tree | 95b8332360e10990dd8ea7047d53a89510e91471 /pkg/gui/files_panel.go | |
parent | 67bbeb195b52121976840de0cd1a20cf1462b5e0 (diff) |
better interface
Diffstat (limited to 'pkg/gui/files_panel.go')
-rw-r--r-- | pkg/gui/files_panel.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go index c2ec97e3b..aa01b4b36 100644 --- a/pkg/gui/files_panel.go +++ b/pkg/gui/files_panel.go @@ -14,6 +14,7 @@ import ( "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/commands" "github.com/jesseduffield/lazygit/pkg/utils" + "github.com/mgutz/str" ) // list panel functions @@ -356,13 +357,14 @@ func (gui *Gui) handleCommitEditorPress() error { }) } - gui.PrepareSubProcess("git", "commit") + gui.PrepareSubProcess("git commit") return nil } // PrepareSubProcess - prepare a subprocess for execution and tell the gui to switch to it -func (gui *Gui) PrepareSubProcess(commands ...string) { - gui.SubProcess = gui.GitCommand.PrepareCommitSubProcess() +func (gui *Gui) PrepareSubProcess(command string) { + splitCmd := str.ToArgv(command) + gui.SubProcess = gui.OSCommand.PrepareSubProcess(splitCmd[0], splitCmd[1:]...) gui.g.Update(func(g *gocui.Gui) error { return gui.Errors.ErrSubProcess }) |