Skip to content

feat: Repeat operations for add/change/delete. #360

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

Merged
merged 4 commits into from
Mar 12, 2025
Merged

Conversation

kylechui
Copy link
Owner

@kylechui kylechui commented Nov 24, 2024

TODO: Repeat deletions, unit test stuff.

Feels like there's a cleaner way to parse the user input than the scuffed nil stuff I have right now. Although at the very least it's isolated in the get_char function 🤔

@kylechui kylechui linked an issue Nov 24, 2024 that may be closed by this pull request
1 task
@kylechui kylechui changed the title feat: Repeat delimiters for add. feat: Repeat operations for add/change/delete. Nov 24, 2024
@kylechui
Copy link
Owner Author

Another issue that has come up is the idea of deleting multiple surrounds. If we do ds3), but the buffer only has ((hello)), should the delete function no-op or do a "best-effort" and try to delete as many as possible?

@kylechui
Copy link
Owner Author

kylechui commented Nov 24, 2024

The case (foo) cursor_here (bar) is so cursed with ds2b---I want to avoid mutating the buffer until everything is found so change_surround can highlight everything properly, but finding the next possible surrounding pair to delete while ignoring already found pairs seems incredibly hard, if not impossible. If only I didn't implement reverse search.... 😭

Because I'm selfish I'm going to remove reverse search from the plugin in this branch just to see how the plugin feels

@kylechui kylechui closed this Nov 25, 2024
@kylechui kylechui force-pushed the feat/repeat-delimiters branch from 0fef5ac to dca2e99 Compare November 25, 2024 00:19
@kylechui kylechui reopened this Nov 25, 2024
@sebszyller
Copy link

Chiming in to say that would love to see it happen. Pesky markdown surrounds 🤷‍♂️

@kylechui
Copy link
Owner Author

kylechui commented Mar 8, 2025

New idea: Number prefixes should resolve things, i.e. [count][action][input], e.g. 3ysiwb or 2ds}.

@kylechui kylechui force-pushed the feat/repeat-delimiters branch from 324cfd8 to 1b56191 Compare March 8, 2025 20:35
@kylechui kylechui mentioned this pull request Mar 8, 2025
1 task
@kylechui kylechui marked this pull request as ready for review March 12, 2025 17:51
@kylechui kylechui merged commit ded28a6 into main Mar 12, 2025
4 checks passed
@kylechui kylechui deleted the feat/repeat-delimiters branch March 13, 2025 03:32
phgz pushed a commit to phgz/nvim-surround that referenced this pull request Mar 28, 2025
* feat: Very jank way of supporting numeric prefixes for normal_surround.

* fix: Slightly smarter way of handling numeric prefixes for normal_surround.

* feat: Repeat visual surrounds.

* tests: Repeating delimiters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improved count support
2 participants