Skip to content

LexVB Folding inconsistency #307

@pryrt

Description

@pryrt

Folding is different depending on whether the line after a sub is properly indented, whether there's a blank line, or whether it's improperly indented.

(screenshots from SciTE 5.5.5 with fold.symbols=3 to make folding more obvious)

Properly Indented (folds correctly):

Sub NameHere()
    Set HelpBookP = 5
    Set HelpBookQ = 5

    if a=b then
        Set HelpBookQ = 9
    end if
    Range("K1:K5")
End Sub

Image

Blank line between (fold symbols not showing, but does fold if you click the missing boxed-+):

Sub NameHere()

    Set HelpBookP = 5
    Set HelpBookQ = 5

    if a=b then
        Set HelpBookQ = 9
    end if
    Range("K1:K5")
End Sub

Image => Image

Bad indentation (start-of-fold moves to the unindented Set instead of starting at the Sub where it belongs)

Sub NameHere()
Set HelpBookP = 5
    Set HelpBookQ = 5

    if a=b then
        Set HelpBookQ = 9
    end if
    Range("K1:K5")
End Sub

Image

Visual Basic does not apply meaning to leading/trailing whitespace (unlike Python), so the way it's folded should not be dependent on whitespace. But this experiment strongly implies that LexVB is considering whitespace when deciding on where/how to fold.

(this bug report comes from this Notepad++ Community discussion)

Metadata

Metadata

Assignees

No one assigned

    Labels

    visual basicCaused by the Visual Basic lexer

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions