sync with server on startup

Mentioned in #13 and #36.
This commit is contained in:
Gokcehan committed 2016-11-10 23:43:54 +03:00
1 parent 428f9e3dcb
commit 3b5759efba
3 files changed
+21 -7

No files matched your search

+1 -7
View File
@@ -336,16 +336,10 @@ func (e *CallExpr) eval(app *App, args []string) {
app.ui.renew()
app.nav.renew(app.ui.wins[0].h)
case "sync":
list, copy, err := loadFiles()
if err != nil {
if err := app.nav.sync(); err != nil {
msg := fmt.Sprintf("sync: %s", err)
app.ui.message = msg
log.Printf(msg)
return
}
app.nav.saves = make(map[string]bool)
for _, f := range list {
app.nav.saves[f] = copy
}
case "echo":
app.ui.message = strings.Join(e.args, " ")