cleanup (#2013)
This commit is contained in:
1 parent
17971fd66e
commit
8c5648ab33
4 files changed
+22
-22
No files matched your search
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user