Skip to content

Commit

Permalink
fix quoting issues in filenames with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Aug 31, 2022
1 parent 84bc9b7 commit 8bc4e15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dotfiles/kakoune/rc/lf.kak
Expand Up @@ -8,7 +8,7 @@ define-command -docstring 'start navigating with lf' lf-browse %{

"$1" -selection-path "$OUT" "$2"
if test -f "$OUT"; then
printf "evaluate-commands -client %s edit %s\n" "$3" "$(cat "$OUT")" | kak -p "$4"
printf "evaluate-commands -client %s 'edit \"%s\"'\n" "$3" "$(cat "$OUT")" | kak -p "$4"
fi
} -- %opt{lf_path} %val{buffile} %val{client} %val{session}
}
8 changes: 4 additions & 4 deletions dotfiles/kakoune/rc/open.kak
Expand Up @@ -5,8 +5,8 @@ define-command -docstring 'open files named similarly to the current buffer' ope
set -euo pipefail
cd $5

FILE="$(git ls-files --others --cached --exclude-standard | $1 $2 | grep -Fxv "$2" | fzf --tiebreak index --preview "bat --color=always -p {}")"
printf "evaluate-commands -client %s edit %s\n" "$3" "$FILE" | kak -p $4
FILE="$(git ls-files --others --cached --exclude-standard | "$1" "$2" | grep -Fxv "$2" | fzf --tiebreak index --preview "bat --color=always -p {}")"
printf "evaluate-commands -client %s \"edit '%s'\"\n" "$3" "$FILE" | kak -p "$4"
} -- %opt{similar_sort_path} %val{bufname} %val{client} %val{session} %sh{ echo $PWD }
}

Expand All @@ -20,8 +20,8 @@ define-command -docstring 'open buffers named similarly to the current buffer' o
OPTIONS="$(printf "%s\n%s" "$OPTIONS" "$OPTION")"
done

BUFFER="$(echo "$OPTIONS" | $1 $2 | grep -Fxv "$2" | grep -ve '^$' | fzf --tiebreak index --preview "bat --color=always -p {}")"
printf "evaluate-commands -client %s edit '%s'\n" "$3" "$BUFFER" | kak -p $4
BUFFER="$(echo "$OPTIONS" | "$1" "$2" | grep -Fxv "$2" | grep -ve '^$' | fzf --tiebreak index --preview "bat --color=always -p {}")"
printf "evaluate-commands -client %s \"edit '%s'\"\n" "$3" "$BUFFER" | kak -p "$4"
} -- %opt{similar_sort_path} %val{bufname} %val{client} %val{session} %sh{ echo $PWD } %val{buflist}
}

Expand Down

0 comments on commit 8bc4e15

Please sign in to comment.