finished/working with extra comments

This commit is contained in:
DevAtDawn 2021-12-16 06:54:09 -07:00 committed by GitHub
parent b756573be8
commit 38f807c1f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,30 +17,26 @@ function navi-widget -d "Show cheat sheets"
end end
function smart_replace function smart_replace
set -l current_buffer (commandline -b) # set -l current_buffer (commandline -b)
set -l current_process (commandline -p) set -l current_process (commandline -p)
# set -l current_job (commandline -j)
set -l best_match (navi --print --best-match --query $current_process) set -l best_match (navi --print --best-match --query $current_process)
echo $best_match $current_process
if [ $current_process != $best_match ] if [ $current_process = $best_match ]
echo "true" # if [ $current_process != $best_match ]
commandline -i $best_match # echo "true"
set -l new_process (navi --print --query $current_process)
# echo $new_process
commandline -p $new_process
commandline -f repaint
else else
echo "false" # echo "false"
navi-widget commandline -p $best_match
commandline -f repaint
# commandline -p ' '$best_match
# navi-widget
end end
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 bind \cg smart_replace
if bind -M insert > /dev/null 2>&1 if bind -M insert > /dev/null 2>&1