Skip to main content

Module replace

Module replace 

Source
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 backspaces times, press Delete deletes times, then type insert. 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.