Skip to content

Textcode noindent#158

Open
glelouet wants to merge 1 commit into
phax:masterfrom
glelouet:textcode_noindent
Open

Textcode noindent#158
glelouet wants to merge 1 commit into
phax:masterfrom
glelouet:textcode_noindent

Conversation

@glelouet
Copy link
Copy Markdown
Contributor

@glelouet glelouet commented Jun 6, 2026

fix the formatter adding arbitrary spaces/indentation in a text block

  1. the base idea is to build on a StringBuilder when generating a textblock against a formatter, only appending the sb at the end, rather than directly append all lines.
  2. This requires to have visibility of the newline property used. So IJFormatter, JFormatter, SourcePrintWriter all have a getter for that internal value (which in the case of JFormater calls the internal sourceprintwriter)
  3. ran sh/install and a lot of things changed, no idea why. At least the output of the textblock is correct.

@glelouet
Copy link
Copy Markdown
Contributor Author

glelouet commented Jun 6, 2026

ok, all those random space changes are because when I checkout the GenerateTestFiles, git replaces its starting spaces with tabs, including in the textblock ; but once placed in comment, the now-tab spacing is no more replaced with spaces because it's not starting anymore.

Its not a problem for the decoration spaces, which are discarded at compile time, but for that one line that is indented it becomes a issue.

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.

1 participant