Skip to content
Merged

cleanup #2013

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
40 changes: 20 additions & 20 deletions doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a-h> ${{
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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lf.1
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down