Skip to content

Commit

Permalink
fixes #647 Screen.Clear — Flickering on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gdamore committed Dec 3, 2023
1 parent 50882fc commit 2917c38
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions console_win.go
Expand Up @@ -38,7 +38,6 @@ type cScreen struct {
curx int
cury int
style Style
clear bool
fini bool
vten bool
truecolor bool
Expand Down Expand Up @@ -972,11 +971,6 @@ func (s *cScreen) writeString(x, y int, style Style, ch []uint16) {
func (s *cScreen) draw() {
// allocate a scratch line bit enough for no combining chars.
// if you have combining characters, you may pay for extra allocations.
if s.clear {
s.clearScreen(s.style, s.vten)
s.clear = false
s.cells.Invalidate()
}
buf := make([]uint16, 0, s.w)
wcs := buf[:]
lstyle := styleInvalid
Expand Down Expand Up @@ -1165,12 +1159,7 @@ func (s *cScreen) Clear() {
}

func (s *cScreen) Fill(r rune, style Style) {
s.Lock()
if !s.fini {
s.cells.Fill(r, style)
s.clear = true
}
s.Unlock()
s.cells.Fill(r, style)

Check warning on line 1162 in console_win.go

View check run for this annotation

Codecov / codecov/patch

console_win.go#L1162

Added line #L1162 was not covered by tests
}

func (s *cScreen) clearScreen(style Style, vtEnable bool) {
Expand Down

0 comments on commit 2917c38

Please sign in to comment.