diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-26 22:09:05 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-26 22:09:05 +0200 |
| commit | bc5668ba7bb011e1aa33e4a998d600c8c5ea68fa (patch) | |
| tree | 874aaea41e77d330eb5e83a5f994ea861ffff5c9 | |
| parent | 60484114ecad9e34f9fa1862625bfeecefb081da (diff) | |
Add viinput skeleton for task 530ac084-c699-4dd6-8abc-d35c852c2226
| -rw-r--r-- | internal/viinput/edit.go | 3 | ||||
| -rw-r--r-- | internal/viinput/model.go | 28 | ||||
| -rw-r--r-- | internal/viinput/motion.go | 3 |
3 files changed, 34 insertions, 0 deletions
diff --git a/internal/viinput/edit.go b/internal/viinput/edit.go new file mode 100644 index 0000000..375c397 --- /dev/null +++ b/internal/viinput/edit.go @@ -0,0 +1,3 @@ +package viinput + +// Editing helpers will live here in a later task. diff --git a/internal/viinput/model.go b/internal/viinput/model.go new file mode 100644 index 0000000..78e00f3 --- /dev/null +++ b/internal/viinput/model.go @@ -0,0 +1,28 @@ +package viinput + +// Mode represents the current vi-style input state. +type Mode int + +const ( + // ModeInsert accepts normal text entry and cursor editing keys. + ModeInsert Mode = iota + // ModeNormal accepts vi-style commands. + ModeNormal +) + +// Model is the state container for the vi-style input component. +type Model struct { + Prompt string + runes []rune + cursor int + mode Mode + focused bool + pending rune + history [][]rune + wantsExit bool +} + +// New returns a Model initialized for insert mode. +func New() Model { + return Model{mode: ModeInsert} +} diff --git a/internal/viinput/motion.go b/internal/viinput/motion.go new file mode 100644 index 0000000..43c8279 --- /dev/null +++ b/internal/viinput/motion.go @@ -0,0 +1,3 @@ +package viinput + +// Motion helpers will live here in a later task. |
