add sync command to synchronize yanked/deleted files with server

Mentioned in #13 and #36.
This commit is contained in:
Gokcehan committed 2016-11-09 00:39:39 +03:00
1 parent c9023d4cdc
commit 9962827926
4 files changed
+15

No files matched your search

+12
View File
@@ -325,6 +325,18 @@ func (e *CallExpr) eval(app *App, args []string) {
app.ui.sync()
app.ui.renew()
app.nav.renew(app.ui.wins[0].h)
case "sync":
list, copy, err := loadFiles()
if 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, " ")
case "cd":