add sync command to synchronize yanked/deleted files with server
Mentioned in #13 and #36.
This commit is contained in:
parent
c9023d4cdc
commit
9962827926
1
doc.go
1
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
|
||||
|
@ -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
|
||||
|
12
eval.go
12
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":
|
||||
|
Loading…
Reference in New Issue
Block a user