Skip to content
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

Feature Request: Apply to a change to a String #176

Open
PlainviewData opened this issue Apr 23, 2017 · 2 comments
Open

Feature Request: Apply to a change to a String #176

PlainviewData opened this issue Apr 23, 2017 · 2 comments

Comments

@PlainviewData
Copy link

Maybe I'm not seeing it in the docs, but I think it would be nice to apply a Change Object, or an array of them, to a string to be able to create a changed string.

@subwaymatch
Copy link

+1 for this feature

@ExplodingCabbage
Copy link
Collaborator

ExplodingCabbage commented Dec 27, 2023

Makes sense, but figuring out how to adapt the logic in applyPatch is not entirely trivial. That logic assumes that the changes are a series of hunks with line numbers and local context (rather than literally the entire file content being included in the diff like it is with change objects) and that each change is to an entire line; these things aren't reliably true for change objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants