add write mutex to editor

This commit is contained in:
Jesse Duffield 2021-03-29 23:49:40 +11:00
parent 20cddf8f54
commit 5a8b8cb853

View File

@ -341,6 +341,9 @@ func (v *View) moveCursor(dx, dy int, writeMode bool) {
// buffer is increased if the point is out of bounds. Overwrite mode is
// governed by the value of View.overwrite.
func (v *View) writeRune(x, y int, ch rune) error {
v.writeMutex.Lock()
defer v.writeMutex.Unlock()
v.tainted = true
x, y, err := v.realPosition(x, y)