feat(tmux-sessionizer): fuzzy match input
This commit is contained in:
parent
35c5d5ed4b
commit
0b7e18a3f5
1 changed files with 7 additions and 3 deletions
|
@ -10,10 +10,14 @@ let
|
||||||
text = ''
|
text = ''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if [[ $# -eq 1 ]]; then
|
options=$(fd -HIg '.git' ~/ --min-depth 1 --max-depth 5 --type d --prune --exec dirname {} | fzf --filter "''$*")
|
||||||
selected=$1
|
|
||||||
|
if [[ -z $options ]]; then
|
||||||
|
return 1
|
||||||
|
elif [[ $(wc -l <<< "$options") -eq 1 ]]; then
|
||||||
|
selected="$options"
|
||||||
else
|
else
|
||||||
selected=$(fd -HIg '.git' ~/ --min-depth 1 --max-depth 5 --type d --prune --exec dirname {} | fzf)
|
echo "$options" | fzf --query="$*"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z $selected ]]; then
|
if [[ -z $selected ]]; then
|
||||||
|
|
Loading…
Reference in a new issue