Add new preference option 'console.head_padding' #919
Merged
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.
The PR adds
console.head_paddingpreference option to configure blank lines printed in terminal/console in each time a sketch is run.The background is found in #911.
Making the change, I originally planned to only add an option for backward compatibility.
However, I finally decided to rewrite the code for "padding by blank lines" using
EditConsole.messageinstead ofSystem.out.printlnto stop printing them in the terminal.The reasons why I think this is safe are as follows:
processing) and not command-line mode (i.e.processing-java).Hence, it would not affect the final products of any projects using Processing either.
So, maybe it would not seriously break backward compatibility in Windows if the blank lines are removed.
processingis run as a background process, so any outputs can mess up the terminal.Moreover, since the blank lines are likely the only outputs from IDE (NOTE:
print/printlndoes not print to terminal from IDE), so I think nobody rely on the behavior.Unfortunately, I have not tested on MacOS and cannot since I don't have any machines.
It would be great if someone tests the change of behavior on MacOS and gives comments.
I also note that, in spite of my comments in #911, the head padding may be useful when
console.auto_clearoption is set tofalse.For example, the following code prints
HelloHelloHellowithout line breaks if you run it three times withconsole.auto_clear = falseandconsole.head_padding = 0on yourpreferences.txt:I wonder if
console.auto_clearand the new optionconsole.head_paddingare worth putting in the preference dialog.In some situations, keeping console outputs may help debugging, but currently nobody knows the option.