Skip to content

TextBlock noindent - #158

Merged
phax merged 2 commits into
phax:masterfrom
glelouet:textcode_noindent
Jun 8, 2026
Merged

TextBlock noindent#158
phax merged 2 commits into
phax:masterfrom
glelouet:textcode_noindent

Conversation

@glelouet

@glelouet glelouet commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

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

glelouet commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator Author

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.

@glelouet

glelouet commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

okay I removed the smudge part from the git config script, this leads to less code changed.

git ls-files -z | xargs -0 rm ; git checkout -- . forced a reload of local files with new filter.

git checkout HEAD -- ** should work too ? dunno, I ran several commands until sh/cleaninstall && git status showed me changes :P

@glelouet glelouet changed the title Textcode noindent TextBlock noindent Jun 8, 2026
@phax

phax commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Okay, sounds nice for me. Are you happy? Can I merge?

@glelouet

glelouet commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

Yeah, I have a lot less changes to undo when committing so I'm pretty happy.
Yeah you can merge.

@phax
phax merged commit 4430232 into phax:master Jun 8, 2026
1 check passed
@glelouet
glelouet deleted the textcode_noindent branch June 8, 2026 19:51
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