mirror of
https://github.com/denisidoro/navi
synced 2024-11-27 22:10:18 +00:00
FINAL v1
the error handling here made me cry (making esc/ctrl+c/ctrl+g exiting work without issues)
This commit is contained in:
parent
5e3215466d
commit
e7dea3ed68
1 changed files with 7 additions and 9 deletions
|
@ -1,6 +1,3 @@
|
|||
|
||||
# navi widget fish | source
|
||||
|
||||
function __call_navi
|
||||
navi --print
|
||||
end
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue