Editor Formatter Issue

I am facing the kind of same problem. I have used SpacingBuilder for created spacing between line breaks between two tokens. I am able to provide line breaks between two tokens but after line break the next token should take some space.
I have provided Alignment.createAlignment() but it is aligning next token in the same line.

Can you help me to solve this issue.




I have/had the same issues, I forward my forums entry, there a multiple suggestions on how to solve this. I did not try the last thing as it is too much of a overall change, but maybe something of that works out for you. 

And if you try that last thing, please let me know if it works for you!


And, another thing, if you don't want to work "pixel perfect" with spaces, you could work with indentation (that is what I have tried, too)

Rustam Vishniakov

If a formatting block starts on the new line, it's position is controlled by indentation, not spacing. The core Block interface has two different methods: getSpacing() and getIndent(). The latter should return an indent usually relative to block's parent, for example returning Indent.getNormalIndent() will indent the block relative to its parent to the number of spaces defined in "Indent" option.



I have provided indent now and also created code style settings which has indent setting to 2. But the problem is in some cases indent applied with 2 spaces but sometimes it increases to more than 2 spaces, sometimes it is increased to even 12 spaces.

Can you tell me, how exactly indent settings are applied or indentation works or how to solve the above problem.



Ishan Jain


Please sign in to leave a comment.