Handle same file open in multiple buffers

This commit is contained in:
Zachary Yedidia
2019-01-14 00:18:49 -05:00
parent 7a20c2db76
commit 23926af9f7
10 changed files with 114 additions and 95 deletions

View File

@@ -57,8 +57,7 @@ type BufHandler struct {
Buf *buffer.Buffer
cursors []*buffer.Cursor
Cursor *buffer.Cursor // the active cursor
Cursor *buffer.Cursor // the active cursor
StartLine int // Vertical scrolling
StartCol int // Horizontal scrolling
@@ -104,11 +103,9 @@ func NewBufHandler(buf *buffer.Buffer, win display.Window) *BufHandler {
h.Buf = buf
h.Window = win
h.cursors = []*buffer.Cursor{buffer.NewCursor(buf, buf.StartCursor)}
h.Cursor = h.cursors[0]
h.Cursor = h.Buf.GetActiveCursor()
h.mouseReleased = true
buf.SetCursors(h.cursors)
return h
}