Esempio n. 1
0
func (c *GlueMarkedUndoGroupsCommand) Run(v *backend.View, e *backend.Edit) error {
	pos := v.UndoStack().Position()
	mark, ok := v.Settings().Get(lime_cmd_mark).(int)
	if !ok {
		return fmt.Errorf("No mark in the current view")
	}
	if l, p := pos-mark, mark; p != -1 && (l-p) > 1 {
		v.UndoStack().GlueFrom(mark)
	}
	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 *RedoCommand) Run(v *backend.View, e *backend.Edit) error {
	v.UndoStack().Redo(c.hard)
	return nil
}