Skip to content

Automatic enter indentation in offside folding languages #171040

Open
@blaumeise20

Description

If you code in a language like TypeScript and you press enter in an unindented line inside a block, VSCode will automatically indent the line to the current level:
Bildschirmfoto 2023-01-11 um 10 09 56
Bildschirmfoto 2023-01-11 um 10 11 01

If you do the same thing in Python, it doesn't work.
Bildschirmfoto 2023-01-11 um 10 12 28
Bildschirmfoto 2023-01-11 um 10 12 07

This makes some sense if you are below a block, because you might want to start some new block. However, if there is still a line with the same indentation as the current block after your cursor, I would like to have it automatically indented. It shouldn't be too hard, because we already have the indentation guides (the grey lines), and those could maybe be used to automatically indent the cursor while being inside a block. Note how the line stops at the second print call:
Bildschirmfoto 2023-01-11 um 10 15 12

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugeditor-autoindentEditor auto indentation issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions