How to remove the first default indent?

Hi, 

On my custom language formatting module builder, I want my code would like this.

statement_1
statement_2
statement_3

but when I press Enter after input 'statement_1/2', It would be like this:

statement_1
statement_2
statement_3

I have made getAlignment(), getSpacing to return null, and getIndent() to return Indent.getNoneIndent()/Indent.getSpaceIndent(0)/Indent.getAbsoluteNoneIndent(), none of them work.

 

So, my question is how to control the first default indent, how to remove it? I don't want it.

 

Thanks in advance.

3 comments

Maybe I was wrong, if i click reformat code, the statement2/3 are aligned with statement1.

So, how to remove the indent after press Enter?  It may not be implemented in formatting module builder, but where?

0

For reference - I think I found the solution.

 

I might need to implement getChildAttributes() in my implementation of Block.

0

Yes, that's correct, if you need to handle the case when Enter is pressed at the end of the line, you need to implement getChildAttributes() method.

0

Please sign in to leave a comment.