Implemented the replace (r and R) actions and replace mode #5

Merged
azpect merged 3 commits from feature/replace into master 2026-04-06 18:30:37 -07:00
2 changed files with 4 additions and 2 deletions
Showing only changes of commit 881a4d6d78 - Show all commits

View File

@ -72,6 +72,10 @@ I rarely use, and even find a bit un-intuitive. Implementing replace mode in a w
actions function the same as insert mode (other than the actual character typing) allows for
a much simpler implementation, as well as a more intuitive user experience.
Replace mode implements and replaces (no pun intended) the last inserted keys of insert mode. Due to
the infrequent use of replace mode, and the '.' action for insert mode, this felt like a natural
trade off.
---
## TODO List

View File

@ -583,8 +583,6 @@ func (h *Handler) handleReplaceKey(m action.Model, key string) tea.Cmd {
buf.UndoStack.BeginBlock(win.Cursor)
}
// TODO: Handle differently
// Record the key for count replay (e.g. 5i...)
m.SetInsertKeys(append(m.InsertKeys(), key))
m.SetLastChangeKeys(append(m.LastChangeKeys(), key))