From 0f47c5428b021b4a8d6fcad1ce00da5ed8379315 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Tue, 26 Feb 2019 21:04:51 +0300 Subject: [PATCH] load directories after copy/move --- eval.go | 6 ------ nav.go | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/eval.go b/eval.go index 3f0c5404..3a70a9cc 100644 --- a/eval.go +++ b/eval.go @@ -616,12 +616,6 @@ func (e *callExpr) eval(app *app, args []string) { app.ui.printf("paste: %s", err) return } - if err := sendRemote("send load"); err != nil { - app.ui.printf("paste: %s", err) - } - if err := sendRemote("send sync"); err != nil { - app.ui.printf("paste: %s", err) - } case "delete": if cmd, ok := gOpts.cmds["delete"]; ok { cmd.eval(app, e.args) diff --git a/nav.go b/nav.go index 81a53e61..32f90763 100644 --- a/nav.go +++ b/nav.go @@ -611,6 +611,12 @@ loop: ui.exprChan <- echo } } + + if err := sendRemote("send load"); err != nil { + errCount++ + echo.args[0] = fmt.Sprintf("[%d] error: %s", errCount, err) + ui.exprChan <- echo + } } func moveAsync(ui *ui, srcs []string, dstDir string) { @@ -643,6 +649,12 @@ func moveAsync(ui *ui, srcs []string, dstDir string) { ui.exprChan <- echo } } + + if err := sendRemote("send load"); err != nil { + errCount++ + echo.args[0] = fmt.Sprintf("[%d] error: %s", errCount, err) + ui.exprChan <- echo + } } func (nav *nav) paste(ui *ui) error { @@ -667,6 +679,10 @@ func (nav *nav) paste(ui *ui) error { return fmt.Errorf("clearing copy/cut buffer: %s", err) } + if err := sendRemote("send sync"); err != nil { + return fmt.Errorf("paste: %s", err) + } + return nil }