1
0

mode.go 269 B

123456789101112131415161718
  1. package editor
  2. type Mode int
  3. const (
  4. ModeNormal Mode = iota
  5. ModeInsert
  6. ModeCommand
  7. )
  8. func (mode Mode) String() string {
  9. switch mode {
  10. case ModeNormal: return "normal"
  11. case ModeInsert: return "insert"
  12. case ModeCommand: return "command"
  13. }
  14. return "unknown"
  15. }