mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
Add lock for updating width and height
This commit is contained in:
committed by
Christian Muehlhaeuser
parent
ab65f2391f
commit
1ee40507ef
@@ -292,8 +292,10 @@ func (r *standardRenderer) insertBottom(lines []string, topBoundary, bottomBound
|
|||||||
func (r *standardRenderer) handleMessages(msg Msg) {
|
func (r *standardRenderer) handleMessages(msg Msg) {
|
||||||
switch msg := msg.(type) {
|
switch msg := msg.(type) {
|
||||||
case WindowSizeMsg:
|
case WindowSizeMsg:
|
||||||
|
r.mtx.Lock()
|
||||||
r.width = msg.Width
|
r.width = msg.Width
|
||||||
r.height = msg.Height
|
r.height = msg.Height
|
||||||
|
r.mtx.Unlock()
|
||||||
|
|
||||||
case clearScrollAreaMsg:
|
case clearScrollAreaMsg:
|
||||||
r.clearIgnoredLines()
|
r.clearIgnoredLines()
|
||||||
|
|||||||
Reference in New Issue
Block a user