mirror of
https://github.com/walles/moar.git
synced 2024-09-21 17:08:34 +03:00
Mark string readers complete from the start
Related to #31. Before this change, string readers always rendered as in-progress. With this change in place, they instead always render as complete.
This commit is contained in:
parent
eace381664
commit
17ac7e8e62
@ -177,10 +177,13 @@ func NewReaderFromStream(reader io.Reader, fromFilter *exec.Cmd) *Reader {
|
||||
// NewReaderFromText creates a Reader from a block of text
|
||||
func NewReaderFromText(name string, text string) *Reader {
|
||||
noExternalNewlines := strings.Trim(text, "\n")
|
||||
done := make(chan bool, 1)
|
||||
done <- true
|
||||
return &Reader{
|
||||
name: &name,
|
||||
lines: strings.Split(noExternalNewlines, "\n"),
|
||||
lock: &sync.Mutex{},
|
||||
done: done,
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user