feate add motions dt dT df df ct cT cf cF and fix f/F and t/T not working on capital letters#130
Closed
BrettKulp wants to merge 4 commits into
Closed
feate add motions dt dT df df ct cT cf cF and fix f/F and t/T not working on capital letters#130BrettKulp wants to merge 4 commits into
BrettKulp wants to merge 4 commits into
Conversation
leohenon
reviewed
May 17, 2026
Owner
leohenon
left a comment
There was a problem hiding this comment.
Thanks, the uppercase f/F/t/T fix looks good. Please split that into a separate PR so we can merge it independently.
For th rest, I don’t want to add separate pending states for each combination. I know the current operator handling is already pretty explicit, but these motions add another level of pending input, so I think this is the right point to introduce shared operator/motion abstraction instead.
Current issues:
- failed
cf/ctshould not enter insert mode findChar()moves the cursor before the edit snapshot, so undo cursor restore can be wrong
I’m going to take over this part and implement it around shared logic that computes the f/t span first. Thanks for the initial implementation/tests.
Author
|
Sounds good. Here is that PR #132 with f/F/t/T fix only. Thanks! |
This was referenced May 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add motions dt dT df df ct cT cf cF
The regular t/T and f/F now correctly work with capital letters
lmk if anything needs changed.
Also could make this logic that is similar in multiple motions more reusable if you want want to go that way. They are different enough that I wasn't sure if that would be the right thing to do
if (isPrintable(event) && !hasModifier(event)) {
const forward = deleteFind === "df" || deleteFind === "dt"
const till = deleteFind === "dt" || deleteFind === "dT"
const textarea = input.textarea()
const start = textarea.cursorOffset
const char = value(event)
findChar(textarea, char, forward, till)
if (textarea.cursorOffset !== start) {
const span = forward
? { start, end: textarea.cursorOffset + 1 }
: { start: textarea.cursorOffset, end: start + 1 }
const text = textarea.plainText.slice(span.start, span.end)
edit(() => {
deleteSpan(textarea, span)
if (text) setRegister({ text, linewise: false })
textarea.cursorOffset = Math.min(start, textarea.cursorOffset)
})
}
input.state.setLastFind({ char, forward, till })
input.state.clearPending()
event.preventDefault()
return true
}
input.state.clearPending()
event.preventDefault()
return true