NewEventHandler returns a new EventHandler
(buf *SharedBuffer, cursors []*Cursor)
| 152 | |
| 153 | // NewEventHandler returns a new EventHandler |
| 154 | func NewEventHandler(buf *SharedBuffer, cursors []*Cursor) *EventHandler { |
| 155 | eh := new(EventHandler) |
| 156 | eh.UndoStack = new(TEStack) |
| 157 | eh.RedoStack = new(TEStack) |
| 158 | eh.buf = buf |
| 159 | eh.cursors = cursors |
| 160 | return eh |
| 161 | } |
| 162 | |
| 163 | // ApplyDiff takes a string and runs the necessary insertion and deletion events to make |
| 164 | // the buffer equal to that string |