Execute a textevent and add it to the undo stack
(t *TextEvent)
| 236 | |
| 237 | // Execute a textevent and add it to the undo stack |
| 238 | func (eh *EventHandler) Execute(t *TextEvent) { |
| 239 | if eh.RedoStack.Len() > 0 { |
| 240 | eh.RedoStack = new(TEStack) |
| 241 | } |
| 242 | eh.UndoStack.Push(t) |
| 243 | |
| 244 | b, err := config.RunPluginFnBool(nil, "onBeforeTextEvent", luar.New(ulua.L, eh.buf), luar.New(ulua.L, t)) |
| 245 | if err != nil { |
| 246 | screen.TermMessage(err) |
| 247 | } |
| 248 | |
| 249 | if !b { |
| 250 | return |
| 251 | } |
| 252 | |
| 253 | ExecuteTextEvent(t, eh.buf) |
| 254 | } |
| 255 | |
| 256 | // Undo the first event in the undo stack. Returns false if the stack is empty. |
| 257 | func (eh *EventHandler) Undo() bool { |
no test coverage detected