allow submodule init and show submodule diff with a prefix

This commit is contained in:
Jesse Duffield
2020-10-01 08:18:16 +10:00
parent f3be2b3e68
commit da3e00823f
12 changed files with 101 additions and 102 deletions

View File

@@ -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