Skip to content

Commit

Permalink
Refresh ViewLines before returning them
Browse files Browse the repository at this point in the history
It's surprising to clients if this doesn't happen, and it's a very cheap call,
so we can afford it.
  • Loading branch information
stefanhaller committed Dec 1, 2024
1 parent 8edbb1a commit bb2e36a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions view.go
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,8 @@ func (v *View) ViewBufferLines() []string {
v.writeMutex.Lock()
defer v.writeMutex.Unlock()

v.refreshViewLinesIfNeeded()

lines := make([]string, len(v.viewLines))
for i, l := range v.viewLines {
str := lineType(l.line).String()
Expand Down

0 comments on commit bb2e36a

Please sign in to comment.