func (c *GlueMarkedUndoGroupsCommand) Run(v *backend.View, e *backend.Edit) error { pos := v.UndoStack().Position() if mark, ok := v.Settings().Get(lime_cmd_mark).(int); ok { if l, p := pos-mark, mark; p != -1 && (l-p) > 1 { v.UndoStack().GlueFrom(mark) } } else { return fmt.Errorf("No mark in the current view") } return nil }
func (c *MaybeMarkUndoGroupsForGluingCommand) Run(v *backend.View, e *backend.Edit) error { if !v.Settings().Has(lime_cmd_mark) { v.Settings().Set(lime_cmd_mark, v.UndoStack().Position()) } return nil }
func (c *UndoCommand) Run(v *backend.View, e *backend.Edit, args backend.Args) error { v.UndoStack().Undo(c.hard) return nil }
func (c *RedoCommand) Run(v *backend.View, e *backend.Edit) error { v.UndoStack().Redo(c.hard) return nil }
func (c *MarkUndoGroupsForGluingCommand) Run(v *backend.View, e *backend.Edit, args backend.Args) error { v.Settings().Set(lime_cmd_mark, v.UndoStack().Position()) return nil }