Skip to content

Commit

Permalink
add an on-select command (#864)
Browse files Browse the repository at this point in the history
  • Loading branch information
laktak committed Oct 15, 2022
1 parent 747aff8 commit e10ef91
Show file tree
Hide file tree
Showing 7 changed files with 157 additions and 125 deletions.
6 changes: 3 additions & 3 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ func (app *app) loop() {
curr, err := app.nav.currFile()
if err == nil {
if d.path == app.nav.currDir().path {
app.ui.loadFile(app.nav, true)
app.ui.loadFile(app, true)
}
if d.path == curr.path {
app.ui.dirPrev = d
Expand Down Expand Up @@ -462,7 +462,7 @@ func (app *app) loop() {
app.ui.draw(app.nav)
case <-app.ticker.C:
app.nav.renew()
app.ui.loadFile(app.nav, false)
app.ui.loadFile(app, false)
app.ui.draw(app.nav)
}
}
Expand Down Expand Up @@ -536,7 +536,7 @@ func (app *app) runShell(s string, args []string, prefix string) {
anyKey()
}

app.ui.loadFile(app.nav, true)
app.ui.loadFile(app, true)

switch prefix {
case "%":
Expand Down
5 changes: 5 additions & 0 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ The following special shell commands are used to customize the behavior of lf wh
delete
pre-cd
on-cd
on-select
on-quit
The following commands/keybindings are provided by default:
Expand Down Expand Up @@ -904,6 +905,10 @@ This shell command can be defined to be executed before changing a directory.
This shell command can be defined to be executed after changing a directory.
on-select
This shell command can be defined to be executed after the selection changes.
on-quit
This shell command can be defined to be executed before quit.
Expand Down
6 changes: 6 additions & 0 deletions docstring.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e10ef91

Please sign in to comment.