Compare commits

..

2 Commits

Author SHA1 Message Date
Zachary Yedidia
3d845eefe3 Increase totalwidth as well for correct tab alignment 2023-02-13 14:28:07 -08:00
Zachary Yedidia
d8576d0fe6 Display a tilde before every uppercase letter 2023-02-13 14:24:49 -08:00

View File

@@ -627,10 +627,11 @@ func (w *BufWindow) displayBuffer() {
default:
if unicode.IsUpper(r) {
width = 2
} else {
width = runewidth.RuneWidth(r)
totalwidth += width
totalwidth += 2
break
}
width = runewidth.RuneWidth(r)
totalwidth += width
}
word = append(word, glyph{r, combc, curStyle, width})
@@ -666,19 +667,21 @@ func (w *BufWindow) displayBuffer() {
if unicode.IsUpper(r.r) {
draw('~', nil, r.style, true, true)
draw(r.r, r.combc, r.style, true, false)
} else {
draw(r.r, r.combc, r.style, true, true)
bloc.X++
continue
}
// Draw any extra characters either spaces for tabs or @ for incomplete wide runes
if r.width > 1 {
char := ' '
if r.r != '\t' {
char = '@'
}
draw(r.r, r.combc, r.style, true, true)
for i := 1; i < r.width; i++ {
draw(char, nil, r.style, true, false)
}
// Draw any extra characters either spaces for tabs or @ 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)
}
}
bloc.X++