fix: auto complete themes in Powershell

This commit is contained in:
Jan De Dobbeleer 2020-11-28 19:56:55 +01:00
parent 249c779146
commit 56a58c700a

View file

@ -152,7 +152,10 @@ function ThemeCompletion {
$commandAst,
$fakeBoundParameter
)
$themes = Get-ChildItem -Path "$PSScriptRoot\themes\*" -Include '*.omp.json' | Sort-Object Name | Select-Object -Property BaseName
$themes = Get-ChildItem -Path "$PSScriptRoot\themes\*" -Include '*.omp.json' | Sort-Object Name | Select-Object -Property @{
label='BaseName'
expression={$_.BaseName.TrimEnd(".omp")}
}
$themes |
Where-Object { $_.BaseName.ToLower().StartsWith($wordToComplete.ToLower()); } |
Select-Object -Unique -ExpandProperty BaseName |