mirror of
https://github.com/RGBCube/ncc
synced 2025-07-31 12:07:48 +00:00
Fix completer
This commit is contained in:
parent
c78959343a
commit
b7f7740d8c
1 changed files with 3 additions and 3 deletions
|
@ -139,15 +139,15 @@ $env.config.completions = {
|
||||||
completer: {|tokens: list<string>|
|
completer: {|tokens: list<string>|
|
||||||
let expanded = scope aliases | where name == $tokens.0 | get --ignore-errors expansion.0
|
let expanded = scope aliases | where name == $tokens.0 | get --ignore-errors expansion.0
|
||||||
|
|
||||||
let expanded = if $expanded != null and $expanded.0 != "cd" {
|
mut expanded_tokens = if $expanded != null and $tokens.0 != "cd" {
|
||||||
$expanded | split row " " | append ($tokens | skip 1)
|
$expanded | split row " " | append ($tokens | skip 1)
|
||||||
} else {
|
} else {
|
||||||
$tokens
|
$tokens
|
||||||
}
|
}
|
||||||
|
|
||||||
$expanded.0 = ($expanded.0 | str trim --left --char "^")
|
$expanded_tokens.0 = ($expanded_tokens.0 | str trim --left --char "^")
|
||||||
|
|
||||||
fish --command $"complete '--do-complete=($expanded | str join ' ')'"
|
fish --command $"complete '--do-complete=($expanded_tokens | str join ' ')'"
|
||||||
| $"value(char tab)description(char newline)" + $in
|
| $"value(char tab)description(char newline)" + $in
|
||||||
| from tsv --flexible --no-infer
|
| from tsv --flexible --no-infer
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue