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.
This commit is contained in:
Gokcehan 2017-10-26 21:16:24 +03:00
parent f907a553ae
commit fed8d73ffe
2 changed files with 2 additions and 3 deletions

View File

@ -374,9 +374,6 @@ func (e *callExpr) eval(app *app, args []string) {
return return
} }
app.nav.renew(app.nav.height) 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 { if err := sendRemote("send sync"); err != nil {
msg := fmt.Sprintf("put: %s", err) msg := fmt.Sprintf("put: %s", err)
app.ui.message = msg app.ui.message = msg

2
nav.go
View File

@ -519,6 +519,8 @@ func (nav *nav) put() error {
// TODO: async? // TODO: async?
saveFiles(nil, false)
return nil return nil
} }