Skip to content

Commit

Permalink
Merge pull request #373 from wardwouts/filter_current_commandline
Browse files Browse the repository at this point in the history
Use what's already typed on the commandline as a filter
  • Loading branch information
denisidoro authored Aug 5, 2020
2 parents 231f977 + 0a71db6 commit f071f85
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions shell/navi.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

_call_navi() {
local selected
if selected="$(printf "%s" "$(navi --print </dev/tty)")"; then
LBUFFER="$selected"
if [ -n "$LBUFFER" ]; then
if selected="$(printf "%s" "$(navi --print --no-autoselect query "${LBUFFER}" </dev/tty)")"; then
LBUFFER="$selected"
fi
else
if selected="$(printf "%s" "$(navi --print </dev/tty)")"; then
LBUFFER="$selected"
fi
fi
zle redisplay
}
Expand Down

0 comments on commit f071f85

Please sign in to comment.