Summary
hardtime.nvim's issue tracker (issue #10, a real third-party user asking for almost exactly tobira's premise) proposed detecting: f<char>h -> suggest t<char> (search-until instead of search-to-then-back-up-one), and its mirror F<char>l -> suggest T<char>. Confirmed via reading lua/tobira/core/patterns.lua's f_repeat handling that no such swap detection currently exists — the only existing f/t-related pattern is f_repeat (repeated f<char> -> suggests ;), which is unrelated.
Why this needs review before implementation
Needs a threshold/confidence decision: is f<char> immediately followed by h (or F<char> followed by l) reliable enough evidence of "the user meant to stop one character earlier" to suggest a command swap, or is this too easily confused with an unrelated, coincidental h/l press right after a search? Also needs a decision on the reverse direction (mentioned by a follow-up commenter on the same hardtime issue): t<char> followed by l -> suggest f<char>, T<char> followed by h -> suggest F<char> (the inverse correction).
Detectability note
Fully keystroke-based — the two keys are directly adjacent in the keystroke stream, no buffer/window state needed.
Relevant files
lua/tobira/core/patterns.lua (near the existing f_repeat handling)
lua/tobira/commands.lua
Summary
hardtime.nvim's issue tracker (issue #10, a real third-party user asking for almost exactly tobira's premise) proposed detecting:
f<char>h-> suggestt<char>(search-until instead of search-to-then-back-up-one), and its mirrorF<char>l-> suggestT<char>. Confirmed via readinglua/tobira/core/patterns.lua'sf_repeathandling that no such swap detection currently exists — the only existingf/t-related pattern isf_repeat(repeatedf<char>-> suggests;), which is unrelated.Why this needs review before implementation
Needs a threshold/confidence decision: is
f<char>immediately followed byh(orF<char>followed byl) reliable enough evidence of "the user meant to stop one character earlier" to suggest a command swap, or is this too easily confused with an unrelated, coincidentalh/lpress right after a search? Also needs a decision on the reverse direction (mentioned by a follow-up commenter on the same hardtime issue):t<char>followed byl-> suggestf<char>,T<char>followed byh-> suggestF<char>(the inverse correction).Detectability note
Fully keystroke-based — the two keys are directly adjacent in the keystroke stream, no buffer/window state needed.
Relevant files
lua/tobira/core/patterns.lua(near the existingf_repeathandling)lua/tobira/commands.lua