parent
80f43fe39c
commit
f6cce2d40c
2
comp.go
2
comp.go
@ -32,7 +32,7 @@ var (
|
||||
"delete",
|
||||
"put",
|
||||
"clear",
|
||||
"renew",
|
||||
"reload",
|
||||
"read",
|
||||
"read-shell",
|
||||
"read-shell-wait",
|
||||
|
4
doc.go
4
doc.go
@ -30,7 +30,7 @@ The following commands are provided by lf with default keybindings:
|
||||
delete (default 'd')
|
||||
put (default 'p')
|
||||
clear (default 'c')
|
||||
renew (default '<c-l>')
|
||||
reload (default '<c-r>')
|
||||
read (default ':')
|
||||
read-shell (default '$')
|
||||
read-shell-wait (default '!')
|
||||
@ -352,7 +352,7 @@ implementation. The default behavior is similar to the following command:
|
||||
elif [ $mode = 'move' ]; then
|
||||
mv -n $list .
|
||||
fi
|
||||
lf -remote "send $id renew"
|
||||
lf -remote "send $id reload"
|
||||
lf -remote "$(printf 'save\nmove\n\n')"
|
||||
lf -remote "send sync"
|
||||
}}
|
||||
|
@ -34,7 +34,7 @@ The following commands are provided by lf with default keybindings:
|
||||
delete (default 'd')
|
||||
put (default 'p')
|
||||
clear (default 'c')
|
||||
renew (default '<c-l>')
|
||||
reload (default '<c-r>')
|
||||
read (default ':')
|
||||
read-shell (default '$')
|
||||
read-shell-wait (default '!')
|
||||
@ -366,7 +366,7 @@ implementation. The default behavior is similar to the following command:
|
||||
elif [ $mode = 'move' ]; then
|
||||
mv -n $list .
|
||||
fi
|
||||
lf -remote "send $id renew"
|
||||
lf -remote "send $id reload"
|
||||
lf -remote "$(printf 'save\nmove\n\n')"
|
||||
lf -remote "send sync"
|
||||
}}
|
||||
|
4
eval.go
4
eval.go
@ -332,10 +332,10 @@ func (e *callExpr) eval(app *app, args []string) {
|
||||
if err := sendRemote("send sync"); err != nil {
|
||||
app.ui.printf("clear: %s", err)
|
||||
}
|
||||
case "renew":
|
||||
case "reload":
|
||||
app.ui.sync()
|
||||
app.ui.renew()
|
||||
app.nav.renew(app.ui.wins[0].h)
|
||||
app.nav.reload()
|
||||
case "read":
|
||||
app.ui.cmdPrefix = ":"
|
||||
case "read-shell":
|
||||
|
11
nav.go
11
nav.go
@ -300,6 +300,17 @@ func (nav *nav) renew(height int) {
|
||||
}
|
||||
}
|
||||
|
||||
func (nav *nav) reload() {
|
||||
nav.dirCache = make(map[string]*dir)
|
||||
|
||||
wd, err := os.Getwd()
|
||||
if err != nil {
|
||||
log.Printf("getting current directory: %s", err)
|
||||
}
|
||||
|
||||
nav.getDirs(wd)
|
||||
}
|
||||
|
||||
func (nav *nav) load(path string) *dir {
|
||||
d, ok := nav.dirCache[path]
|
||||
if !ok {
|
||||
|
2
opts.go
2
opts.go
@ -70,7 +70,7 @@ func init() {
|
||||
gOpts.keys["d"] = &callExpr{"delete", nil}
|
||||
gOpts.keys["c"] = &callExpr{"clear", nil}
|
||||
gOpts.keys["p"] = &callExpr{"put", nil}
|
||||
gOpts.keys["<c-l>"] = &callExpr{"renew", nil}
|
||||
gOpts.keys["<c-r>"] = &callExpr{"reload", nil}
|
||||
gOpts.keys[":"] = &callExpr{"read", nil}
|
||||
gOpts.keys["$"] = &callExpr{"read-shell", nil}
|
||||
gOpts.keys["!"] = &callExpr{"read-shell-wait", nil}
|
||||
|
Loading…
Reference in New Issue
Block a user