Fix yn callback bug

This commit is contained in:
Zachary Yedidia
2019-01-15 00:24:53 -05:00
parent 4a5b759f16
commit 538f0117bc
6 changed files with 41 additions and 30 deletions

View File

@@ -427,11 +427,13 @@ func (b *Buffer) IndentString(tabsize int) []byte {
// SetCursors resets this buffer's cursors to a new list
func (b *Buffer) SetCursors(c []*Cursor) {
b.cursors = c
b.EventHandler.cursors = b.cursors
}
// AddCursor adds a new cursor to the list
func (b *Buffer) AddCursor(c *Cursor) {
b.cursors = append(b.cursors, c)
b.EventHandler.cursors = b.cursors
b.UpdateCursors()
}
@@ -486,6 +488,7 @@ func (b *Buffer) MergeCursors() {
if b.curCursor >= len(b.cursors) {
b.curCursor = len(b.cursors) - 1
}
b.EventHandler.cursors = b.cursors
}
// UpdateCursors updates all the cursors indicies