Skip to content

Commit

Permalink
FINAL v1
Browse files Browse the repository at this point in the history
the error handling here made me cry (making esc/ctrl+c/ctrl+g exiting work without issues)
  • Loading branch information
DevAtDawn authored Dec 16, 2021
1 parent 5e32154 commit e7dea3e
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions shell/navi.plugin.fish
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

# navi widget fish | source

function __call_navi
navi --print
end
Expand All @@ -27,21 +24,22 @@ function smart_replace
commandline -f repaint
else
set -l best_match (navi --print --best-match --query $current_process)
# if [ $navi_last_cmd = $current_process ]

if not [ $best_match > /dev/null ];
commandline -p $current_process
commandline -f repaint
return
end

if [ $best_match = "" ]
# set navi_last_cmd (commandline -p)
# commandline -p $current_process
commandline -p (navi --print --query $current_process)
commandline -f repaint
# else
else if [ $current_process != $best_match ]
commandline -p $best_match
commandline -f repaint
else if [ $current_process = $best_match ]
commandline -p (navi --print --query $current_process)
commandline -f repaint
# else
# commandline -p $current_process
end
end
end
Expand Down

0 comments on commit e7dea3e

Please sign in to comment.