rendering changes, no more "dirty"
This commit is contained in:
parent
13d57534a6
commit
d69f375a57
4 changed files with 43 additions and 55 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue