diff --git a/comp.go b/comp.go index e7469066..da1a6398 100644 --- a/comp.go +++ b/comp.go @@ -37,6 +37,7 @@ var ( "delete", "put", "renew", + "sync", "echo", "cd", "push", diff --git a/doc.go b/doc.go index be5b6cdf..7d035aa4 100644 --- a/doc.go +++ b/doc.go @@ -38,6 +38,7 @@ The following commands are provided by lf with default keybindings. The following commands are provided by lf without default keybindings. + sync synchronizes yanked/deleted files with server echo prints its arguments to the message line cd changes working directory to its argument push simulate key pushes given in its argument diff --git a/docstring.go b/docstring.go index 16d6c0fa..f0b69dbe 100644 --- a/docstring.go +++ b/docstring.go @@ -42,6 +42,7 @@ The following commands are provided by lf with default keybindings. The following commands are provided by lf without default keybindings. + sync synchronizes yanked/deleted files with server echo prints its arguments to the message line cd changes working directory to its argument push simulate key pushes given in its argument diff --git a/eval.go b/eval.go index a1efc492..fbddbc76 100644 --- a/eval.go +++ b/eval.go @@ -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":