-
Notifications
You must be signed in to change notification settings - Fork 194
Cut/Yank multiple words #631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
dcd2c77
dry out cutting logic
alsuren ff8b696
DRY a bit more
alsuren 64a57a2
track when the last cut command was
alsuren 068c05d
cargo clippy --fix
alsuren bdcefd6
keep accumulating when multiple cut commands happen in a row
alsuren 4e87064
simplify LastCutCommand variants, add comments
alsuren 23d2eef
WIP: correctly failing tests
alsuren b51e5d7
a few more tests
alsuren 30c78ea
EditCommand::StopCutting (fixes tests)
alsuren 631b3be
make tests pass
alsuren 25f32a3
few more tests
alsuren 824e203
more test cases
alsuren File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
a few more tests
- Loading branch information
commit b51e5d767c96cacf1f5f089316e8b54e39ff21a9
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rstest is me trying to implement something like https://matklad.github.io/2021/05/31/how-to-test.html#Data-Driven-Testing
I tried to avoid writing test cases in terms of internal data structures like EditCommand because they tend not to be refactor-proof. Vim commands are already text based, so they feel like a natural base for a testing microformat/DSL. Might be worth making an equivalent DSL for Emacs using the
C-wnotation from the Emacs/bash docs. Probably something for another PR though.I think this particular example might be stretching the usefulness of the interface I built a bit though. A better way to write this test would probably be on top of a
check_commands(before, commands, after)helper, probably using $0/$1 to encode the cursor position, as the rust-analyzer tests do. The rest of thesum_to_zerotest cases could then be rebased on top of such an abstraction.I'm not sure when I will have another opportunity for recreational hacking. It's been wiping me out recently. I am planning to take some time off in October, so I will have another stab at it then if I haven't finished it before.