From 17ca6d403b7ff0a32a441a746cab6d2c25c15d38 Mon Sep 17 00:00:00 2001 From: makeworld Date: Wed, 10 Mar 2021 19:05:04 -0500 Subject: [PATCH] Read (un)lock mutex instead --- textview.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/textview.go b/textview.go index e723881..4b3ea03 100644 --- a/textview.go +++ b/textview.go @@ -1322,7 +1322,7 @@ func (t *TextView) MouseHandler() func(action MouseAction, event *tcell.EventMou // of the longest line in the buffer. This is the dimensions of the text buffer. // This is not the dimensions of the TextView on the screen. func (t *TextView) TextDimensions() (int, int) { - t.Lock() - defer t.Unlock() + t.RLock() + defer t.RUnlock() return t.longestLine, len(t.buffer) }