package action

// Mode constants for editor mode
type Mode int

const (
	NormalMode Mode = iota
	InsertMode
	CommandMode
	VisualMode
	VisualLineMode
	VisualBlockMode
)

func (m Mode) ToString() string {
	switch m {
	case NormalMode:
		return "NORMAL"
	case InsertMode:
		return "INSERT"
	case CommandMode:
		return "COMMAND"
	case VisualMode:
		return "VISUAL"
	case VisualLineMode:
		return "V-LINE"
	case VisualBlockMode:
		return "V-BLOCK"
	default:
		return "-----"
	}
}

func (m Mode) IsVisualMode() bool {
	return m == VisualMode ||
		m == VisualLineMode ||
		m == VisualBlockMode
}
