diff --git a/app.go b/app.go index 9fe525dd..68e46950 100644 --- a/app.go +++ b/app.go @@ -426,7 +426,6 @@ func (app *app) loop() { } app.watchDir(d) - onLoad(app, d.fileNames()) app.ui.draw(app.nav) case r := <-app.nav.regChan: diff --git a/doc.md b/doc.md index bab6fcb2..1ab08d9a 100644 --- a/doc.md +++ b/doc.md @@ -1497,14 +1497,14 @@ This is useful for scripting actions based on the internal state of lf. For example, to select a previous command using fzf and execute it: map ${{ - clear - cmd=$( - lf -remote "query $id history" | - awk -F'\t' 'NR > 1 { print $NF}' | - sort -u | - fzf --reverse --prompt='Execute command: ' - ) - lf -remote "send $id $cmd" + clear + cmd=$( + lf -remote "query $id history" | + awk -F'\t' 'NR > 1 { print $NF}' | + sort -u | + fzf --reverse --prompt='Execute command: ' + ) + lf -remote "send $id $cmd" }} There is also a `quit` command to quit the server when there are no connected clients left, and a `quit!` command to force quit the server by closing client connections first: @@ -1728,22 +1728,22 @@ It works well when combined with `addcustominfo`. The following example can be used to display git indicators in the info column: cmd on-load &{{ - cd "$(dirname "$1")" || exit 1 - git rev-parse >/dev/null 2>&1 || exit 0 + cd "$(dirname "$1")" || exit 1 + git rev-parse >/dev/null 2>&1 || exit 0 - cmds="" + cmds="" - for file in "$@"; do - status=$(git status --porcelain --ignored -- "$file" | cut -c1-2 | head -n1) + for file in "$@"; do + status=$(git status --porcelain --ignored -- "$file" | cut -c1-2 | head -n1) - if [ -n "$status" ]; then - cmds="${cmds}addcustominfo ${file} \"$status\"; " - else - cmds="${cmds}addcustominfo ${file} ''; " - fi - done + if [ -n "$status" ]; then + cmds="${cmds}addcustominfo ${file} \"$status\"; " + else + cmds="${cmds}addcustominfo ${file} ''; " + fi + done - lf -remote "send $id :$cmds" + lf -remote "send $id :$cmds" }} # COLORS diff --git a/lf.1 b/lf.1 index 6171f150..b484f808 100644 --- a/lf.1 +++ b/lf.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 2.11.4 .\" -.TH "LF" "1" "2025-06-19" "r35-22-gb76d254" "DOCUMENTATION" +.TH "LF" "1" "2025-06-20" "" "DOCUMENTATION" .hy .SH NAME .PP diff --git a/ui.go b/ui.go index 08e533fe..b913d836 100644 --- a/ui.go +++ b/ui.go @@ -549,6 +549,7 @@ func (win *win) printDir(ui *ui, dir *dir, context *dirContext, dirStyle *dirSty line := append(filename, ' ') win.print(ui.screen, lnwidth+2+runeSliceWidth(icon), i, st, string(line)) + // print over the empty space we reserved for the custom info if showInfo && custom != "" { win.print(ui.screen, off, i, st, custom) }