mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-18 14:55:38 -04:00
Display a tilde before every capital letter for Canute
This commit is contained in:
parent
7ee77d56a6
commit
f61dd7a894
@ -2,6 +2,7 @@ package display
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
"unicode"
|
||||
|
||||
runewidth "github.com/mattn/go-runewidth"
|
||||
"github.com/zyedidia/micro/v2/internal/buffer"
|
||||
@ -624,9 +625,13 @@ func (w *BufWindow) displayBuffer() {
|
||||
width = util.Min(ts, maxWidth-vloc.X)
|
||||
totalwidth += ts
|
||||
default:
|
||||
if unicode.IsUpper(r) {
|
||||
width = 2
|
||||
} else {
|
||||
width = runewidth.RuneWidth(r)
|
||||
totalwidth += width
|
||||
}
|
||||
}
|
||||
|
||||
word = append(word, glyph{r, combc, curStyle, width})
|
||||
wordwidth += width
|
||||
@ -658,6 +663,10 @@ func (w *BufWindow) displayBuffer() {
|
||||
}
|
||||
|
||||
for _, r := range word {
|
||||
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)
|
||||
|
||||
// Draw any extra characters either spaces for tabs or @ for incomplete wide runes
|
||||
@ -671,6 +680,7 @@ func (w *BufWindow) displayBuffer() {
|
||||
draw(char, nil, r.style, true, false)
|
||||
}
|
||||
}
|
||||
}
|
||||
bloc.X++
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user