From da3e00823f733743c2bd8076d13955dbed9fcbae Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Thu, 1 Oct 2020 08:18:16 +1000 Subject: allow submodule init and show submodule diff with a prefix --- pkg/gui/main_panels.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'pkg/gui/main_panels.go') diff --git a/pkg/gui/main_panels.go b/pkg/gui/main_panels.go index 3cff20be6..68c28ff23 100644 --- a/pkg/gui/main_panels.go +++ b/pkg/gui/main_panels.go @@ -62,7 +62,8 @@ func (gui *Gui) createRenderStringWithoutScrollTask(str string) *renderStringWit } type runCommandTask struct { - cmd *exec.Cmd + cmd *exec.Cmd + prefix string } func (t *runCommandTask) GetKind() int { @@ -73,8 +74,13 @@ func (gui *Gui) createRunCommandTask(cmd *exec.Cmd) *runCommandTask { return &runCommandTask{cmd: cmd} } +func (gui *Gui) createRunCommandTaskWithPrefix(cmd *exec.Cmd, prefix string) *runCommandTask { + return &runCommandTask{cmd: cmd, prefix: prefix} +} + type runPtyTask struct { - cmd *exec.Cmd + cmd *exec.Cmd + prefix string } func (t *runPtyTask) GetKind() int { @@ -85,6 +91,10 @@ func (gui *Gui) createRunPtyTask(cmd *exec.Cmd) *runPtyTask { return &runPtyTask{cmd: cmd} } +func (gui *Gui) createRunPtyTaskWithPrefix(cmd *exec.Cmd, prefix string) *runPtyTask { + return &runPtyTask{cmd: cmd, prefix: prefix} +} + type runFunctionTask struct { f func(chan struct{}) error } @@ -113,11 +123,11 @@ func (gui *Gui) runTaskForView(viewName string, task updateTask) error { case RUN_COMMAND: specificTask := task.(*runCommandTask) - return gui.newCmdTask(viewName, specificTask.cmd) + return gui.newCmdTask(viewName, specificTask.cmd, specificTask.prefix) case RUN_PTY: specificTask := task.(*runPtyTask) - return gui.newPtyTask(viewName, specificTask.cmd) + return gui.newPtyTask(viewName, specificTask.cmd, specificTask.prefix) } return nil -- cgit v1.2.3