Skip to content

Commit 6b2a3c4

Browse files
committed
Merge branch 'release/v2.2.1'
2 parents 0c1744f + acbc6f5 commit 6b2a3c4

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

README.org

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ by [[http://thepowershellguy.com/][the PowerShell Guy]], and [[https://github.co
88

99
It provides two main functionalities:
1010

11-
1. Directly provide coloring outputs of ~Get-ChildItem~ by modifying
11+
1. Directly provide coloring of ~Get-ChildItem~ output by modifying
1212
~Out-Default~. Once the module is imported, ~Get-ChildItem~'s output will
1313
be automatically colored. It does support pipeline (e.g., ~Get-ChildItem |
1414
grep ".git"~). Also, now the directory name and the headers of its output
@@ -45,6 +45,8 @@ After cloning the repo, you can put files in =/src= folder into
4545
=Get-ChildItemColor= folder under your =PSModulePath=
4646
(e.g., =$ENV:UserProfile\Documents\PowerShell\Modules= for PowerShell 6 and
4747
later). The =master= branch always contains the latest release version.
48+
** Install from [[https://chocolatey.org][Chocolatey]]
49+
The module is available as a [[https://chocolatey.org/packages/get-childitemcolor][Chocolatey package]]. Install it using =choco install get-childitemcolor=.
4850
* Usage
4951
When you import the module:
5052

@@ -100,6 +102,9 @@ $Global:GetChildItemColorVerticalSpace = 1
100102
* Authors
101103
- [[http://github.com/joonro][Joon Ro]].
102104
* Changelog
105+
** v2.2.1
106+
- [[https://github.com/joonro/Get-ChildItemColor/pull/44][Fix uint32 error in cell width calculation]]. (Thanks to [[https://github.com/DanielCarmingham][DanielCarmingham]])
107+
- [[https://github.com/joonro/Get-ChildItemColor/pull/35][Add Chocolatey install instructions]]. (Thanks to [[https://github.com/pauby][pauby]])
103108
** v2.2.0
104109
- Fix #27, Display issue with Chinese. (Thanks to [[https://github.com/shiena][shiena]])
105110
** v2.1.1

src/PSColorHelper.ps1

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@ function LengthInBufferCells
3434
function LengthInBufferCell
3535
{
3636
param ([char]$Char)
37-
# The following is based on http://www.cl.cam.ac.uk/~mgk25/c/wcwidth.c
37+
# The following is based on https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
3838
# which is derived from https://www.unicode.org/Public/UCD/latest/ucd/EastAsianWidth.txt
3939
[bool]$isWide = $Char -ge 0x1100 -and
4040
($Char -le 0x115f -or # Hangul Jamo init. consonants
4141
$Char -eq 0x2329 -or $Char -eq 0x232a -or
42-
([uint32]($Char - 0x2e80) -le (0xa4cf - 0x2e80) -and
43-
$Char -ne 0x303f) -or # CJK ... Yi
44-
([uint32]($Char - 0xac00) -le (0xd7a3 - 0xac00)) -or # Hangul Syllables
45-
([uint32]($Char - 0xf900) -le (0xfaff - 0xf900)) -or # CJK Compatibility Ideographs
46-
([uint32]($Char - 0xfe10) -le (0xfe19 - 0xfe10)) -or # Vertical forms
47-
([uint32]($Char - 0xfe30) -le (0xfe6f - 0xfe30)) -or # CJK Compatibility Forms
48-
([uint32]($Char - 0xff00) -le (0xff60 - 0xff00)) -or # Fullwidth Forms
49-
([uint32]($Char - 0xffe0) -le (0xffe6 - 0xffe0)))
42+
($Char -ge 0x2e80 -and $Char -le 0xa4cf -and
43+
$Char -ne 0x303f) -or # CJK ... Yi
44+
($Char -ge 0xac00 -and $Char -le 0xd7a3) -or # Hangul Syllables
45+
($Char -ge 0xf900 -and $Char -le 0xfaff) -or # CJK Compatibility Ideographs
46+
($Char -ge 0xfe10 -and $Char -le 0xfe19) -or # Vertical forms
47+
($Char -ge 0xfe30 -and $Char -le 0xfe6f) -or # CJK Compatibility Forms
48+
($Char -ge 0xff00 -and $Char -le 0xff60) -or # Fullwidth Forms
49+
($Char -ge 0xffe0 -and $Char -le 0xffe6))
5050

5151
# We can ignore these ranges because .Net strings use surrogate pairs
5252
# for this range and we do not handle surrogage pairs.

0 commit comments

Comments
 (0)