oleg-shilo / codemap.vscode

Code map (syntax tree) of the active document
MIT License
84 stars 28 forks source link

How to insert spaces at the "prefix"? #47

Closed juanbretti closed 4 years ago

juanbretti commented 4 years ago

Hello, I want to insert a few spaces at the prefix, something like:

    {
        "pattern": "^(\\s*)#### (.*)----",
        "clear": "#|----",
        "prefix": "\\s\\s",
        "icon": "level3"
    },

But instead of 'space''space', I get '\s\s' before the line. Thanks!

juanbretti commented 4 years ago

Better could be to add indentation to the icons, like what happens one function is created inside another.

I have this for creating sections/outlines/folds in my Python code:

    {
        "pattern": "^(\\s*)#### (.*)----",
        "clear": "#|----",
        "prefix": "··",
        "icon": "level3"
    },
    {
        "pattern": "^(\\s*)### (.*)----",
        "clear": "#|----",
        "prefix": "·",
        "icon": "level2"
    },
    {
        "pattern": "^(\\s*)## (.*)----",
        "clear": "#|----",
        "icon": "level1"
    },

And I get this:

indent

But I would like to have indentation like:

image

juanbretti commented 4 years ago

Duplicate #32