Skip to content

Commit

Permalink
Fix rendering regression
Browse files Browse the repository at this point in the history
If ViewLinesHeight was called concurrently with drawing the view, the viewLines
could be truncated.

Regression introduced in 3fd1316.
  • Loading branch information
stefanhaller committed Aug 24, 2024
1 parent 5083ac1 commit 6bfac15
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions view.go
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,9 @@ func (v *View) LinesHeight() int {

// ViewLinesHeight is the count of view lines (i.e. lines including wrapping)
func (v *View) ViewLinesHeight() int {
v.writeMutex.Lock()
defer v.writeMutex.Unlock()

v.refreshViewLinesIfNeeded()
return len(v.viewLines)
}
Expand Down

0 comments on commit 6bfac15

Please sign in to comment.