mirror of
https://github.com/youwen5/liminalOS.git
synced 2025-06-20 05:59:51 -07:00
feat: use better nushell fish completion path parser
This commit is contained in:
parent
775fc350f7
commit
1599dbe329
1 changed files with 6 additions and 7 deletions
|
@ -1,13 +1,12 @@
|
|||
let fish_completer = {|spans|
|
||||
fish --command $'complete --escape "--do-complete=($spans | str join " ")"'
|
||||
| $"value(char tab)description(char newline)" + $in
|
||||
| from tsv --flexible --no-infer
|
||||
| each {|i|
|
||||
if '\' in $i.value {
|
||||
$i | merge {'value': $"\"($i.value | str replace -a '\' '')\""}
|
||||
} else {$i}
|
||||
fish --command $"complete '--do-complete=($spans | str join ' ')'"
|
||||
| from tsv --flexible --noheaders --no-infer
|
||||
| rename value description
|
||||
| update value {
|
||||
if ($in | path exists) {$'"($in | str replace "\"" "\\\"" )"'} else {$in}
|
||||
}
|
||||
}
|
||||
|
||||
# This completer will use fish by default
|
||||
let external_completer = {|spans|
|
||||
let expanded_alias = scope aliases
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue