Closed DougGlancy closed 7 years ago
Indents fine for me using 2.0.10.33433.
Maybe it's fixed, or it depends on indenter settings?
Sub Test()
If True Then
i = 1
Submariner = i 'or SubTotalsOn or Subpar or anything that starts with "Sub:
End If
End Sub
FWIW this shouldn't be affected by the parser in any way. The parser works on complete tokens. the Sub token can only span a complete sub everything inside it is a different token.
@Vogel612 , to be clear, I have no actual knowledge of how the indenting works. My bug reporting was just based on reducing some code to the simplest reproducible example. However, based on what you said about tokens, is it possible that the "Sub..." inside a procedure is seen as the start a new token? At any rate @ThunderFrame thinks this may be solved. I'm just going off of the release version 2.0.0.18871.
I can't replicate this with my settings either. Can you post your rubberduck.config file from \Users\You\AppData\Roaming\Rubberduck?
@comintern, Here's two. One where I clicked the reset button, and one with a couple of changes: indent to 3, and Indent Entire Procedure Body unchecked. The behavior is the same in both cases.
rubberduck_dglancy_reset.txt rubberduck_dglancy_modified.txt
@comintern, okay, I'll close it then.
If a line in a procedure starts with the three characters "sub" then indenting of that procedure stops at that point. So this...
Yields this:
I tested it in a Sub and a Function. I assume the parsing hits "Sub" and resets. I tried using a variable name that starts with "Function" and the indenting worked fine.