rubberduck-vba / Rubberduck

Every programmer needs a rubberduck. COM add-in for the VBA & VB6 IDE (VBE).
https://rubberduckvba.com
GNU General Public License v3.0
1.91k stars 300 forks source link

Indenter setting for keeping line labels on isolated line #3200

Open ThunderFrame opened 7 years ago

ThunderFrame commented 7 years ago

Line labels can appear on the same line as statements, which can cause excessive indenting of code.

Sub foo()
  On Error GoTo CatastrophicDivideByZeroErrorHandler
  Debug.Print 1 / 0
  Exit Sub
CatastrophicDivideByZeroErrorHandler: MsgBox "Too much ZERO"
End Sub

Would, optionally, be better rewritten and indented as:

Sub foo()
  On Error GoTo CatastrophicDivideByZeroErrorHandler
  Debug.Print 1 / 0
  Exit Sub
CatastrophicDivideByZeroErrorHandler:
  MsgBox "Too much ZERO"
End Sub
retailcoder commented 7 years ago

Arguably that isn't the indenter's job. An inspection, a quick fix, could do this too.