Only trim left; use prefix algo
This commit is contained in:
parent
e516852566
commit
c47f506313
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue