Expand description
Replacement planning: turning a chosen correction into a concrete edit — a backspace count, a delete count, and the text to type — over the buffered text.
See the “Replacement mechanics” section of DESIGN.md.
Structs§
- Edit
- A concrete edit for the emulation layer to apply to the focused
application: press Backspace
backspacestimes, press Deletedeletestimes, then typeinsert. Splitting the deletion into a left half (Backspace) and a right half (Delete) lets us rewrite a word the caret sits inside without first having to move the caret to the end of it.
Functions§
- plan_
word_ replacement - Plan the edit that replaces the word at the caret with
correction, preserving the whitespace the user typed after it.