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 # For hiding the "nu-complete zoxide path" command
module zoxide-commands { module zoxide-commands {
def "nu-complete zoxide path" [context: string] { 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 = ( let completions = (
^zoxide query --list --exclude $env.PWD -- ...$parts ^zoxide query --list --exclude $env.PWD -- ...$parts
| lines | lines
@ -79,7 +79,8 @@ module zoxide-commands {
{ {
options: { options: {
sort: false, sort: false,
completion_algorithm: substring, completion_algorithm: prefix,
positional: false,
case_sensitive: false, case_sensitive: false,
}, },
completions: $completions, completions: $completions,