lf opener fixes
This commit is contained in:
parent
1eba4db0c7
commit
34b3e87a57
|
@ -13,16 +13,29 @@ set promptfmt # this is set in a function later
|
|||
# HACK: This is needed to trigger the opening function of the taolf nvim plugin
|
||||
cmd open ${{
|
||||
set +u
|
||||
[ "$lf_user_multiedit" = "true" ] && { $EDITOR $fx; return; }
|
||||
[ "$lf_user_multiedit" = "true" ] && {
|
||||
if [ -n "$TAOLF" ]; then
|
||||
lf -remote "send $id open"
|
||||
else
|
||||
$EDITOR $fx
|
||||
return
|
||||
fi
|
||||
}
|
||||
$OPENER "$f"
|
||||
}}
|
||||
|
||||
cmd pushedit %{{
|
||||
set +u
|
||||
echo "Open: " && read files
|
||||
echo
|
||||
echo $files | xargs touch
|
||||
lf -remote "send $id \$$OPENER $files
|
||||
send $id unselect"
|
||||
echo $files | xargs -r touch
|
||||
if [ -n "$TAOLF" ]; then
|
||||
lf -remote "send $id toggle $files
|
||||
send $id open"
|
||||
else
|
||||
lf -remote "send $id \$$OPENER $files
|
||||
send $id unselect"
|
||||
fi
|
||||
}}
|
||||
|
||||
cmd open-with ${{
|
||||
|
|
|
@ -1,17 +1,13 @@
|
|||
#!/bin/sh
|
||||
# shellcheck disable=2154
|
||||
|
||||
[ -n "$TAOLF" ] && {
|
||||
lf -remote "send $id toggle $(printf "'%s'" "$@"); open"
|
||||
}
|
||||
|
||||
term=
|
||||
[ -n "$SCRATCHPAD" ] && {
|
||||
set -- -ft "$@"
|
||||
term="$TERMCMD -e"
|
||||
}
|
||||
|
||||
# HACK: workaround for an nvim/taolf bug with opening empty files
|
||||
# HACK: workaround for a bug with opening empty files in vim
|
||||
[ "$(rifle -c "$XDG_CONFIG_HOME/lf/rifle.conf" | head -1 | cut -d ':' -f 2)" = "editor" ] && $term vim "$@"
|
||||
|
||||
set -- -p0 -c "$XDG_CONFIG_HOME/lf/rifle.conf" "$@"
|
||||
|
|
Loading…
Reference in New Issue