Skip to content

Incompatiblity with maptz.regionfolder #56

@TheOnly8Z

Description

@TheOnly8Z

I tried using RegionFolder with a custom configuration to be able to fold my code blocks. GLua files seem to prevent this extension from creating fold spaces even though the same file and configuration works with regular Lua.
https://marketplace.visualstudio.com/items?itemName=maptz.regionfolder

To Replicate

I am using the following configuration for this extension in settings.json. This setup is identical to the one in the extension, but renamed for glua instead of lua.

    "maptz.regionfolder": {
        "[glua]": {
            "foldEnd": "--#endregion",
            "foldEndRegex": "--[\\s]*#endregion",
            "foldStart": " --#region [NAME]",
            "foldStartRegex": "--[\\s]*#region[\\s]*(.*)"
        }
    },

When the file is configured as GLua (bottom right language setting), the folding widgets do not appear even though regions are defined correctly.
image

After switching language to Lua, the fold widgets immediately become visible and can be used to collapse code.
image
image

If I switch back to GLua without folding anything, the fold widgets disappear.

Curiously however, if the fold regions are folded before switching from Lua to GLua, they remain folded and can be used without disappearing, persisting even after the file is closed and reopened and within new windows.

image

The ability to fold certain user-defined regions is super convenient for large, sectioned bulk files that have segments but no code blocks for each. If this can be resolved (or something similar implemented into GLua Enhanced) it'd be a great producibility tool.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions