From fed8d73ffe8fda0c664615b9c3de5e2bb9717007 Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Thu, 26 Oct 2017 21:16:24 +0300 Subject: [PATCH] move server file clearing to builtin 'put' command If a user defines an asynchronous 'put' command it will fetch an empty list from the server since server file list is immediately cleared after every 'put' command. Now that we move the clearing to the builtin 'put' command, users need to explicitly clear server file list in their custom 'put' commands if they like. --- eval.go | 3 --- nav.go | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/eval.go b/eval.go index 8f36971..846c452 100644 --- a/eval.go +++ b/eval.go @@ -374,9 +374,6 @@ func (e *callExpr) eval(app *app, args []string) { return } app.nav.renew(app.nav.height) - app.nav.save(false) - app.nav.saves = make(map[string]bool) - saveFiles(nil, false) if err := sendRemote("send sync"); err != nil { msg := fmt.Sprintf("put: %s", err) app.ui.message = msg diff --git a/nav.go b/nav.go index db5a329..87a3958 100644 --- a/nav.go +++ b/nav.go @@ -519,6 +519,8 @@ func (nav *nav) put() error { // TODO: async? + saveFiles(nil, false) + return nil }