mirror of
https://github.com/jroimartin/gocui.git
synced 2025-05-01 22:17:55 +08:00
add write mutex to editor
This commit is contained in:
parent
20cddf8f54
commit
5a8b8cb853
3
edit.go
3
edit.go
@ -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
|
// buffer is increased if the point is out of bounds. Overwrite mode is
|
||||||
// governed by the value of View.overwrite.
|
// governed by the value of View.overwrite.
|
||||||
func (v *View) writeRune(x, y int, ch rune) error {
|
func (v *View) writeRune(x, y int, ch rune) error {
|
||||||
|
v.writeMutex.Lock()
|
||||||
|
defer v.writeMutex.Unlock()
|
||||||
|
|
||||||
v.tainted = true
|
v.tainted = true
|
||||||
|
|
||||||
x, y, err := v.realPosition(x, y)
|
x, y, err := v.realPosition(x, y)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user