use the same goroutine to wait preview command

Mentioned in #5.
This commit is contained in:
Gokcehan 2016-09-18 12:56:13 +03:00
parent d51e99adc1
commit 1e7811334e

2
ui.go
View File

@ -353,8 +353,8 @@ func (ui *UI) loadFile(nav *Nav) {
log.Print(msg) log.Print(msg)
} }
defer cmd.Wait()
defer out.Close() defer out.Close()
go func() { defer cmd.Wait() }()
reader = out reader = out
} else { } else {
f, err := os.Open(path) f, err := os.Open(path)