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

Fix trailing_newline issue in Builder::build #17

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

andyyu2004
Copy link
Contributor

Hey! I found a little issue where building a rope using the builder would result in different line lengths compared to constructing the Rope directly (using Rope::from).

Buffer::has_trailing_newline transitively depends on len_left which depends on left_summary being up to date. However, Builder::finish was calling them in the reverse order so this wouldn't work in some cases.

Since has_trailing_newline is now false instead of true, the line length is too great by 1.

`Buffer::has_trailing_newline` transitively depends on `len_left` which
depends on `left_summary` being up to date. However, `Builder::finish`
was calling them in the reverse order.
@noib3 noib3 merged commit 468818b into nomad:main Apr 1, 2024
8 checks passed
@noib3
Copy link
Collaborator

noib3 commented Apr 1, 2024

Thank you!

@andyyu2004 andyyu2004 deleted the builder-finish-fix branch April 1, 2024 09:45
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.

2 participants