Allow lastdir/selection to be written to stdout (#1399)

* Allow lastdir/selection to be written to `stdout`

* Quick fix for runPagerOn
This commit is contained in:
Joe Lim authored and GitHub committed 2023-08-28 11:30:16 +10:00
1 parent e0abb29a00
commit 63d21b5a3e
4 files changed
+42 -37

No files matched your search

+1 -20
View File
@@ -1447,27 +1447,8 @@ func (e *callExpr) eval(app *app, args []string) {
}
if gSelectionPath != "" {
out, err := os.Create(gSelectionPath)
if err != nil {
log.Printf("opening selection file: %s", err)
return
}
defer out.Close()
var path string
if list, err := app.nav.currFileOrSelections(); err == nil {
path = strings.Join(list, "\n")
} else {
return
}
_, err = out.WriteString(path)
if err != nil {
log.Printf("writing selection file: %s", err)
}
app.selectionOut, _ = app.nav.currFileOrSelections()
app.quitChan <- struct{}{}
return
}