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

Issue with multi-line String indenting #2604

Closed rdster closed 7 years ago

rdster commented 7 years ago

I have a large message that I'm dropping into a string variable before using in a Msgbox. The String is quite long and has multiple vbCrLf's and _'s. I've tried playing with the Indenter's settings but cannot find what will line them all up.

Message = "It appears that you might need to Roll Over the data from the previous year." & vbCrLf & vbCrLf _
        & "The CTB sheet (behind this box) is what will be rolled over.  If this sheet is already full and you are " _
        & "importing data for a new year, you should do the roll over." & vbCrLf & vbCrLf _
                                           & "Would you like to continue with the Roll Over?" & vbCrLf & vbCrLf _
                                           & "Yes - Data will be rolled to PTB (this can't be undone automatically)." & vbCrLf _
                                           & "No - Data will replace data for Jan on CTB" & vbCrLf _
                                           & "Cancel - All processing wil stop.  Click this if you aren't sure so you can check."
Response = MsgBox(Message, vbYesNoCancel + vbInformation, "Roll Over Last Year's Data?")

I have tried moving the &'s to the start of each new line as well as keeping them at the end, but the bottom part is still indented way over. Is there another way I should be typing this in for the Indenter to keep them all lined up on the left?

comintern commented 7 years ago

Looks like it's trying to align on the comma after new year. Probably an issue with string escaping in FunctionAlign.

rdster commented 7 years ago

Looks like that was it, I removed that comma, and it snapped into position.