Esempio n. 1
0
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
}
Esempio n. 2
0
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
}
Esempio n. 3
0
func (c *UndoCommand) Run(v *backend.View, e *backend.Edit, args backend.Args) error {
	v.UndoStack().Undo(c.hard)
	return nil
}
Esempio n. 4
0
func (c *RedoCommand) Run(v *backend.View, e *backend.Edit) error {
	v.UndoStack().Redo(c.hard)
	return nil
}
Esempio n. 5
0
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
}