Skip to content

indent-rainbow interacts weirdly with python indentation #181

@Sorontik

Description

@Sorontik

I have a size-4-tab-indented python-file.
I use the default python extensions ms-python.python, ms-python.debugpy and ms-python.vscode-pylance

The error does not occur with other languages like markdown or json.

the error:

If indent-rainbow is active and i create a new line from an indented line, the new line is indented with spaces instead of tabs and the result is immediately marked in the error-color by indent rainbow.
E.g.: the first line is indented with 3 Tabs, then i press enter and the new line is indented with 3 spaces

expected behaviour:

If i disable rainbow-indent (without changing anything else) and create another new line, the error no longer occurs and the new line is indented with tabs as expected.

environment:

I have changed the following settings

"indentRainbow.lightIndicatorStyleLineWidth": 3,
"indentRainbow.tabmixColor": "rgba(200,32,30,0.8)",
"editor.guides.indentation": false,
"indentRainbow.colors": [

// alpha default 0.7

// "rgba(255,255,64,0.07)",	// yellow
// "rgba(127,255,127,0.07)",	// light green
// "rgba(255,127,255,0.07)",	// pink
// "rgba(79,236,236,0.07)",	// light blue


"rgba(255,255,64,0.15)", // alpha def 0.7
"rgba(127,255,127,0.15)",
"rgba(255,127,255,0.15)",
"rgba(79,236,236,0.15)",

],
"indentRainbow.indicatorStyle": "light",

I'm not sure how vs-code and the python extensions interact exactly, but i have set the following indentation-related settings, which work as expected if indent-rainbow is deactivated.

"editor.insertSpaces": false,
"editor.detectIndentation": false,
"[python]": {
    "editor.formatOnType": true,
    "editor.autoIndent": "advanced"
},

Unfortunately, i couldn't find any relevant logs from indent-rainbow to attach here.

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