Closed dmerejkowsky closed 3 years ago
I'm really proud of the new architecture. @tux3, would you mind taking a look and tell me what you think?
Also, not really sure about the last commit ...
Also, not really sure about the last commit ...
I like it, but I'm maybe a little biased, if you listened to me you would have lifetimes everywhere =)
Sorry didnt have much time to review. But I very much like the idea. Next step is to make a proper release and post on r/commandline and/or r/rust ? 😆
Yeah - probably ;)
Cool, I tried locally it works better than before :) Did my best to review, but haven't been written rust in a while.
@cgestes I think I addressed all your feedbacks in 3e6a052
If that's ok with you, we can merge this :)
Instead of just using string.replace or re.replace_all, actually do the work ourselves and compute a list of input and output fragments
Each fragment is a struct containing some text (either added or removed) and some position
This allows use to display the exact diff.
Implementation notes:
Replace line_patcher module by just replacer
Compute the list of patters and replacements much earlier (and just one) when using --subvert
Also, implement Train-Case (also known as Http-Case) handling
Display the patch while the source files are read. This means less shuffling of data around
Tweak output
Old:
Patching foo/bar.js --- old is old +++ new is new
New:
foo/bar.js 3: old is old foo/bar.js 3: new is new
Fix #15