Skip to content

Commit

Permalink
Merge pull request #536 from dahlbyk/rkeithhill/reorder-clr-lookup
Browse files Browse the repository at this point in the history
Lookup HtmlColors before ConsoleColors
  • Loading branch information
dahlbyk authored Jan 18, 2018
2 parents 71a49dd + ea1c6c8 commit 46c47d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/AnsiUtils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,18 @@ function Get-VirtualTerminalSequence ($color, [int]$offset = 0) {

if ($color -is [String]) {
try {
if ($null -ne ($color -as [System.ConsoleColor])) {
$color = [System.ConsoleColor]$color
}
elseif ($ColorTranslatorType) {
if ($ColorTranslatorType) {
$color = $ColorTranslatorType::FromHtml($color)
}
}
catch {
Write-Debug $_
}

# Hard to get here but DarkYellow is not an HTML color but is a ConsoleColor
if (($color -isnot $ColorType) -and ($null -ne ($consoleColor = $color -as [System.ConsoleColor]))) {
$color = $consoleColor
}
}

if ($ColorType -and ($color -is $ColorType)) {
Expand Down
2 changes: 1 addition & 1 deletion src/posh-git.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ AliasesToExport = @()
PrivateData = @{
PSData = @{
# Tags applied to this module. These help with module discovery in online galleries.
Tags = @('git', 'prompt', 'tab', 'tab-completion', 'tab-expansion', 'tabexpansion')
Tags = @('git', 'prompt', 'tab', 'tab-completion', 'tab-expansion', 'tabexpansion', 'PSEdition_Core')

# A URL to the license for this module.
LicenseUri = 'https://github.com/dahlbyk/posh-git/blob/develop/LICENSE.txt'
Expand Down

0 comments on commit 46c47d7

Please sign in to comment.