1
0
Fork 0

taolf fzfgrep fix

This commit is contained in:
Luca Bilke 2024-03-04 10:06:53 +01:00
parent 1b22c5ab20
commit daccf77ffa
1 changed files with 6 additions and 5 deletions

View File

@ -26,8 +26,11 @@ cmd open ${{
cmd pushedit %{{
set +u
echo "Open: " && read files
echo
files=$1
[ -z $files ] && {
echo "Open: " && read files
echo
}
echo $files | xargs -r touch
if [ -n "$TAOLF" ]; then
lf -remote "send $id unselect
@ -162,10 +165,8 @@ cmd fzfgrep ${{
row="$(echo "$res" | cut -d':' -f2)"
column="$(echo "$res" | cut -d':' -f3)"
if [ -n "$res" ]; then
# shellcheck disable=2154
lf -remote "send $id select '$file'"
if [ -n "$VIM" ]; then
lf -remote "send $id open '$file'"
lf -remote "send $id pushedit '$file'"
elif { [ "$EDITOR" = "nvim" ] || [ "$EDITOR" = "vim" ]; } && [ -n "$EMBEDDED" ]; then
lf -remote "send $id \$$EDITOR +'call cursor($row, $column)' -- $([ -n "$EMBEDDED" ] && echo "--") '$file'"
else