-
Notifications
You must be signed in to change notification settings - Fork 53
ed: save space in editor buffer #938
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
Conversation
* The substitution s/\z/NEW/ produced the unwanted outcome of $lines[$x] containing two lines of text * Address this by not including trailing newlines in the editor buffer anymore * Introduce helper function get_terminated_line() which adds the newline * Now s/\z/NEW/ is interpreted the same as s/$/NEW/, i.e. append NEW to end of line * Bump version number in case of regressions * Removing the newlines from the editor buffer also reduces memory usage, but that is not the main intent of this patch
Pull Request Test Coverage Report for Build 13069671346Details
💛 - Coveralls |
I don't know enough about ed, but is this how the other versions work? Specifically, if I use If tis patch makes it work like the other ed's, I'm fine with this. Typically you have compatibility notes in the PR, but not this time. |
The \z match includes the newline, which was problematic because text could be substituted after the newline, which is supposed to terminate the line string. |
Ah, I get it now. Thanks for the clarification. |
Test...