About: Pretty-print (wrap) JSON settings dump#96
Merged
romanlefler merged 1 commit intoromanlefler:developmentfrom Jan 26, 2026
Merged
About: Pretty-print (wrap) JSON settings dump#96romanlefler merged 1 commit intoromanlefler:developmentfrom
romanlefler merged 1 commit intoromanlefler:developmentfrom
Conversation
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.
Use the three-argument form of
JSON.stringify()to dump the settings object line-wrapped and with 1-space indents, for readability when pasted into bug reports (or anywhere else).For example, in my recently-opened issue, instead of this:
the pasted dump would look like this:
(I don't love that the entire
details-listis still dumped onto a single line, but that's a consequence of theRecord<string, string>type of the temporary object, and the value ofdetails-list(an(as)-formatGVariant) having already been dumped to string form usingGVariant::print().)