Skip to content

Make line commit unconditional and remove try_commit_line macro#628

Open
nicoburns wants to merge 2 commits into
linebender:mainfrom
nicoburns:unconditional-commit
Open

Make line commit unconditional and remove try_commit_line macro#628
nicoburns wants to merge 2 commits into
linebender:mainfrom
nicoburns:unconditional-commit

Conversation

@nicoburns
Copy link
Copy Markdown
Collaborator

@nicoburns nicoburns commented May 25, 2026

This refactors and simplifies the line-breaking code.

Changes made:

  • Eliminate the "fake conditionality" from the try_commit_line function (it returned a bool as if it was conditional (which historically it used to be), but in reality it was always returned true). Rename it just commit_line to reflect this reality.
  • Take advantage of this non-conditionality to make start_new_line call commit_line internally and remove the try_commit_line macro (the macro was to reduce boilerplate which no longer exists if commit_line is called from start_new_line).
  • Breaking (low-level API): Make append_cluster_to_line increment self.cluster_idx (callers should no longer increment this themselves)
  • Breaking (low-level API): Make append_inline_box_to_line increment self.item_idx (callers should no longer increment this themselves)

nicoburns added 2 commits May 25, 2026 14:47
Signed-off-by: Nico Burns <nico@nicoburns.com>
Signed-off-by: Nico Burns <nico@nicoburns.com>
@nicoburns nicoburns added the C-parley Relates to the parley crate label May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-parley Relates to the parley crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant