commit b3e1e79b468de4b4c930356eabca388bdcc6ed99 parent b60e17a492eaa8d05c217a207a5fd87338feda12 Author: William Casarin <jb55@jb55.com> Date: Fri, 13 Nov 2020 06:16:31 -0800 fuzz/edit-file: default dir Diffstat:
M | bin/fuzz-edit-file | | | 2 | +- |
M | bin/fuzz-run-command | | | 6 | ------ |
M | bin/fuzz-search-files | | | 2 | +- |
3 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/bin/fuzz-edit-file b/bin/fuzz-edit-file @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -e -file=$(rg --files "$1" | $FUZZER) +file=$(rg --files "${1:-.}" | $FUZZER) echo $EDITOR \"$(readlink -f $file)\" diff --git a/bin/fuzz-run-command b/bin/fuzz-run-command @@ -15,17 +15,11 @@ function runner() { get_cmd="$get_cmd $@" fhist="$HOME/.fuzzhist" touch "$fhist" - export ORIG_OPTS="$FZF_DEFAULT_OPTS" - export INITIAL_QUERY="$@" - if [ -n "$@" ]; then - export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS -q '$@'" - fi cmd="$(eval $get_cmd)" if [ -n "$cmd" ]; then echo "$cmd" >> "$fhist" eval $cmd fi - export FZF_DEFAULT_OPTS="$ORIG_OPTS" } runner "$@" diff --git a/bin/fuzz-search-files b/bin/fuzz-search-files @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -e -res="$(search-files)" +res="$(search-files "$@")" echo $EDITOR $res