Only trim left; use prefix algo

This commit is contained in:
ysthakur 2025-06-09 22:15:29 -04:00
parent e516852566
commit c47f506313
No known key found for this signature in database
1 changed files with 3 additions and 2 deletions

View File

@ -58,7 +58,7 @@ export-env {
# For hiding the "nu-complete zoxide path" command
module zoxide-commands {
def "nu-complete zoxide path" [context: string] {
let parts = $context | str trim | split row " " | skip 1 | each { str downcase }
let parts = $context | str trim --left | split row " " | skip 1 | each { str downcase }
let completions = (
^zoxide query --list --exclude $env.PWD -- ...$parts
| lines
@ -79,7 +79,8 @@ module zoxide-commands {
{
options: {
sort: false,
completion_algorithm: substring,
completion_algorithm: prefix,
positional: false,
case_sensitive: false,
},
completions: $completions,