rendering changes, no more "dirty"

This commit is contained in:
Lobo 2025-10-12 14:01:07 -03:00
parent 13d57534a6
commit d69f375a57
4 changed files with 43 additions and 55 deletions

View file

@ -111,17 +111,14 @@ func (m *Model) layoutSlow() {
total += char.Width
}
switch {
case total > cols:
case total+col > cols:
if total > cols || total+col > cols {
m.lines = append(m.lines, l)
l = &line{}
col = 0
default:
}
for _, char := range chars {
if uniseg.HasTrailingLineBreakInString(char.Grapheme) {
if uniseg.HasTrailingLineBreakInString(char.Grapheme) && col != 0 {
m.lines = append(m.lines, l)
l = &line{}
col = 0