Skip to content

Commit

Permalink
fix: auto complete themes in Powershell
Browse files Browse the repository at this point in the history
  • Loading branch information
JanDeDobbeleer committed Nov 28, 2020
1 parent 249c779 commit 56a58c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/powershell/oh-my-posh/oh-my-posh.psm1
Expand Up @@ -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 |
Expand Down

0 comments on commit 56a58c7

Please sign in to comment.