fix(glyphs): use same int size for validation

resolves #4454
This commit is contained in:
Jan De Dobbeleer 2023-11-19 19:31:58 +01:00 committed by Jan De Dobbeleer
parent 3ab670520b
commit 90dacce1d1
2 changed files with 4 additions and 3 deletions

View file

@ -316,7 +316,7 @@ func escapeGlyphs(s string, migrate bool) string {
} }
if migrate { if migrate {
if val, OK := cp[int(r)]; OK { if val, OK := cp[uint64(r)]; OK {
r = rune(val) r = rune(val)
} }
} }

View file

@ -10,7 +10,7 @@ import (
"github.com/jandedobbeleer/oh-my-posh/src/platform" "github.com/jandedobbeleer/oh-my-posh/src/platform"
) )
type codePoints map[int]int type codePoints map[uint64]uint64
func getGlyphCodePoints() (codePoints, error) { func getGlyphCodePoints() (codePoints, error) {
var codePoints = make(codePoints) var codePoints = make(codePoints)
@ -47,7 +47,8 @@ func getGlyphCodePoints() (codePoints, error) {
if err != nil { if err != nil {
continue continue
} }
codePoints[int(oldGlyph)] = int(newGlyph) codePoints[oldGlyph] = newGlyph
} }
return codePoints, nil return codePoints, nil
} }