chore: cleaned up the file system a bit
This commit is contained in:
parent
88fa53a4d7
commit
65f96a5089
@ -4,43 +4,6 @@ import (
|
|||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 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
|
|
||||||
}
|
|
||||||
|
|
||||||
// Model defines the interface for editor state that actions can modify
|
// Model defines the interface for editor state that actions can modify
|
||||||
type Model interface {
|
type Model interface {
|
||||||
// Text buffer
|
// Text buffer
|
||||||
38
internal/action/mode.go
Normal file
38
internal/action/mode.go
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
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
|
||||||
|
}
|
||||||
@ -1,2 +0,0 @@
|
|||||||
|
|
||||||
hello
|
|
||||||
Loading…
x
Reference in New Issue
Block a user