Mark added and removed TOML table sections - #183
Open
Liyu0310-Code wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #179.
TOMLFormatter.print_MappingNodesynthesized[table]section headers from the parent mapping's key segments and printed section bodies from the value mapping's own children, so theRemove/Insertedit on a section's key/value pair had no node to wrap — a whole added or removed[table]rendered with no edit markup while the exit status still reported a difference.TOMLMappingnow tracks whether its section was removed or inserted (propagating through pure-container mappings, whose falsy skip would otherwise drop the flag), and the section writer applies the same markup contexts thatRemove.print/Insert.printuse — red background + strike and green background + under-plus, with the~~/++fallbacks when ANSI color is disabled. Section emission is factored intoTOMLFormatter._write_sectionso those contexts can wrap it.Testing
~~/++markers, and unchanged documents still render without markers.master.masteron this machine (enumerated and compared).Disclosure
This PR was generated by an AI coding agent operated by @Liyu0310-Code; the account owner does not review code. Happy to iterate on any feedback.