mirror of
https://github.com/walles/moar.git
synced 2025-01-08 14:30:57 +03:00
Render unprintable characters as highlighted '?'
This commit is contained in:
parent
7bf168255a
commit
17d8a0372a
@ -140,13 +140,20 @@ func cellsFromString(s string) []twin.Cell {
|
||||
Style: styleBrokenUtf8,
|
||||
})
|
||||
|
||||
case '\x08': // Backspace
|
||||
case BACKSPACE:
|
||||
cells = append(cells, twin.Cell{
|
||||
Rune: '<',
|
||||
Style: styleBrokenUtf8,
|
||||
})
|
||||
|
||||
default:
|
||||
if !unicode.IsPrint(token.Rune) {
|
||||
cells = append(cells, twin.Cell{
|
||||
Rune: '?',
|
||||
Style: styleBrokenUtf8,
|
||||
})
|
||||
continue
|
||||
}
|
||||
cells = append(cells, token)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user