bump gocui to fix race condition

This commit is contained in:
Jesse Duffield 2023-03-19 15:26:43 +11:00
parent 73c7dc9c5d
commit c28e25524a
4 changed files with 10 additions and 4 deletions

View file

@ -1124,6 +1124,9 @@ func (v *View) clearRunes() {
// BufferLines returns the lines in the view's internal
// buffer.
func (v *View) BufferLines() []string {
v.writeMutex.Lock()
defer v.writeMutex.Unlock()
lines := make([]string, len(v.lines))
for i, l := range v.lines {
str := lineType(l).String()
@ -1142,6 +1145,9 @@ func (v *View) Buffer() string {
// ViewBufferLines returns the lines in the view's internal
// buffer that is shown to the user.
func (v *View) ViewBufferLines() []string {
v.writeMutex.Lock()
defer v.writeMutex.Unlock()
lines := make([]string, len(v.viewLines))
for i, l := range v.viewLines {
str := lineType(l.line).String()