Closed Ikcelaks closed 8 months ago
The code is functional. There are just a few issues remaining.
s*t -> something
s*m -> sometime
Your longest sequence is 3. If you type a*ts
and then realized that you meant to write "sometimes" and not "somethings", your buffer context is now *ts
, so hitting backspace twice and tapping m
does not trigger s*m
as you would hope, and you caught the error almost as soon as possible. So we need to add some amount of extra headroom in the buffer over just the maximum sequence length.
My suggested solution to this is to delay sending the backspaces until we know that the full undo can be done atomically, and if the full undo cannot be done, fall back to resetting the buffer and send a single backspace like default.
I think this is good enough for testing.
The capitalization and incomplete undos when the buffer is too short are still outstanding, but I think this is good enough to be usable now. Please test! This needs so much testing, because it is bad if it breaks in unexpected ways.
With the last commit, incomplete undies should no longer happen. If the buffer doesn't go back enough to complete an undo, only the single automatic backspace will be sent
This feature will enhance the handling of backspace so that tapping backspace will undo the entire action of the previous keypress, and leave the buffer in a state where the recent context is identical to before the previous keypress, even if the previous keypress triggered a complicated action.
This draft contains my refactor
st_trie_search_result_t
so that every feature can get the info they need where and how they need it. Specifically, my feature will need to be able to extract anst_trie_payload_t
using just the trie and an offset to the matching node on the trie. ThePlease take a look at it and give feedback.