func (ca *CompositeAction) Add(a Action) {
	ca.actions = append(ca.actions, a)
}
Add adds the action to this CompositeAction, without first
executing the action
package text
import (
	"fmt"
)
type (
	Action interface {
		Apply()
		Undo()
	}
	CompositeAction struct {
		actions []Action
	}
	insertAction struct {
		buffer Buffer
		point  int
		value  []rune
	}
	eraseAction struct {
		insertAction
		region Region
	}
)
func (ca CompositeAction) String() string {
	ret := fmt.Sprintf("%d actions:\n", len(ca.actions))
	for i := range ca.actions {
		ret += fmt.Sprintf("\t%s\n", ca.actions[i])
	}
	return ret
}
func (ca *CompositeAction) Apply() {
	for _, a := range ca.actions {
		a.Apply()
	}
}
func (ca *CompositeAction) Undo() {
	l := len(ca.actions) - 1
	for i := range ca.actions {
		ca.actions[l-i].Undo()
	}
}