some refactoring in anticipation of the graph feature

This commit is contained in:
Jesse Duffield 2021-11-01 09:35:54 +11:00
parent 7a464ae5b7
commit 2fc1498517
40 changed files with 523 additions and 411 deletions

View file

@ -131,7 +131,6 @@ func (m *ViewBufferManager) NewCmdTask(r io.Reader, cmd *exec.Cmd, prefix string
select {
case <-stop:
m.refreshView()
break outer
default:
}
@ -139,18 +138,18 @@ func (m *ViewBufferManager) NewCmdTask(r io.Reader, cmd *exec.Cmd, prefix string
// if we're here then there's nothing left to scan from the source
// so we're at the EOF and can flush the stale content
m.onEndOfInput()
m.refreshView()
break outer
}
_, _ = m.writer.Write(append(scanner.Bytes(), '\n'))
}
m.refreshView()
case <-stop:
m.refreshView()
break outer
}
}
m.refreshView()
if err := cmd.Wait(); err != nil {
// it's fine if we've killed this program ourselves
if !strings.Contains(err.Error(), "signal: killed") {
@ -158,8 +157,6 @@ func (m *ViewBufferManager) NewCmdTask(r io.Reader, cmd *exec.Cmd, prefix string
}
}
m.refreshView()
if onDone != nil {
onDone()
}