use the same goroutine to wait preview command

Mentioned in #5.
This commit is contained in:
Gokcehan committed 2016-09-18 12:56:13 +03:00
1 parent d51e99adc1
commit 1e7811334e
1 file changed
+1 -1
+1 -1
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)