From 38f807c1f6dad12d46adb65b6a28e907d47e1475 Mon Sep 17 00:00:00 2001 From: DevAtDawn <86164137+DevAtDawn@users.noreply.github.com> Date: Thu, 16 Dec 2021 06:54:09 -0700 Subject: [PATCH] finished/working with extra comments --- shell/navi.plugin.fish | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/shell/navi.plugin.fish b/shell/navi.plugin.fish index 45841b6..05f56c3 100644 --- a/shell/navi.plugin.fish +++ b/shell/navi.plugin.fish @@ -17,30 +17,26 @@ function navi-widget -d "Show cheat sheets" end function smart_replace - set -l current_buffer (commandline -b) + # set -l current_buffer (commandline -b) set -l current_process (commandline -p) + # set -l current_job (commandline -j) set -l best_match (navi --print --best-match --query $current_process) - echo $best_match $current_process - if [ $current_process != $best_match ] - echo "true" - commandline -i $best_match + if [ $current_process = $best_match ] + # if [ $current_process != $best_match ] + # echo "true" + set -l new_process (navi --print --query $current_process) + # echo $new_process + commandline -p $new_process + commandline -f repaint else - echo "false" - navi-widget + # echo "false" + commandline -p $best_match + commandline -f repaint + # commandline -p ' '$best_match + # navi-widget end end - - - - #cli_buffer = commandline - - # split at last | left/right str - # set $user_input - # if query = answer : call Navi-widget - # else smart_replace : - # set output (navi --print --best-match --query $user_input) - # replace userinput string in clibuff or left string += output - # commandline append repaint bind \cg smart_replace if bind -M insert > /dev/null 2>&1