Skip to content

Commit

Permalink
Unicode: Change @ to space as replacement for incomplete wide runes
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeKar committed Oct 22, 2024
1 parent 15b6bf8 commit e8cb65f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
6 changes: 1 addition & 5 deletions internal/display/bufwindow.go
Original file line number Diff line number Diff line change
Expand Up @@ -699,13 +699,9 @@ func (w *BufWindow) displayBuffer() {
for _, r := range word {
draw(r.r, r.combc, r.style, true, true)

// Draw any extra characters either spaces for tabs or @ for incomplete wide runes
// Draw space for incomplete wide runes
if r.width > 1 {
char := ' '
if r.r != '\t' {
char = '@'
}

for i := 1; i < r.width; i++ {
draw(char, nil, r.style, true, false)
}
Expand Down
3 changes: 1 addition & 2 deletions internal/display/infowindow.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,12 @@ func (i *InfoWindow) displayBuffer() {
width = ts
default:
width = runewidth.RuneWidth(r)
char = '@'
}

blocX++
line = line[size:]

// Draw any extra characters either spaces for tabs or @ for incomplete wide runes
// Draw space for incomplete wide runes
if width > 1 {
for j := 1; j < width; j++ {
draw(char, nil, i.defStyle())
Expand Down

0 comments on commit e8cb65f

Please sign in to comment.