summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKid <kidonng@gmail.com>2022-01-16 19:02:36 +0800
committerKid <kidonng@gmail.com>2022-01-16 19:02:36 +0800
commit0160a44b3e1d779a80239d546d9be7cd3ba796be (patch)
tree6d2da6b299f1a1ae14dd5fba27ec014e9ce01a19
parent9186d7bb7cf1f604e4bb8851a4acee1a26650589 (diff)
Insert when not doing smart replace
-rw-r--r--shell/navi.plugin.fish14
1 files changed, 5 insertions, 9 deletions
diff --git a/shell/navi.plugin.fish b/shell/navi.plugin.fish
index c076fc8..280a7b3 100644
--- a/shell/navi.plugin.fish
+++ b/shell/navi.plugin.fish
@@ -1,29 +1,25 @@
function _navi_smart_replace
set -l current_process (commandline -p | string trim)
- if test $current_process = ""
- commandline -p (navi --print)
- commandline -f repaint
+ if test -z $current_process
+ commandline -i (navi --print)
else
set -l best_match (navi --print --best-match --query $current_process)
if not test $best_match > /dev/null
- commandline -p $current_process
- commandline -f repaint
return
end
if test $best_match = ""
- commandline -p (navi --print --query $current_process)
- commandline -f repaint
+ commandline -p (navi --print --query $current_process)
else if test $current_process != $best_match
commandline -p $best_match
- commandline -f repaint
else
commandline -p (navi --print --query $current_process)
- commandline -f repaint
end
end
+
+ commandline -f repaint
end
bind \cg _navi_smart_replace