Improve auto-indent for folded lines

Currently, pressing Enter at the end of an indented line creates a new line at the same indentation level as the line just above it. This is desired behavior when the indented line is visible. But when the cursor is at the end of a folded line (such as a heading), then the new line created should be at the same indentation level as the bottom visible line, not the bottom-most hidden folded line underneath the visible line.

1 Like