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.


I’m looking for a similar feature too.

And according to the reponses in this question, the current behavior is the expected behavior (logically), but it needs to be improved for better user experience.

Below is the relevant response from the moderator in the linked question:

ok, I am not sure I consider this a bug. When you fold the list and you put the cursor after the …, you are actually at the end of the list but still in the list. It’s as if the cursor is at the end of line of the last row.
ENTER → new list item
ENTER → unindent
ENTER → unindent
ENTER → new line

Please, open a feature request for this.

Looks like these features are already available in Obsidian-Outline plugin