Smart indentation support for lists etc. would be nice.
More specifically:
When a new line is created (Insert Newline, Split Line, Start New Line), copy the indentation from the previous line if it contains non-whitespace characters.
When the previous line only contains whitespace characters, unindent to the column of the first non-whitespace character on the first previous line where that character has less indentation.
When the previous line is the first line of a list item, add additional indentation up to the column of the first non-whitespace character (if any, else the end-of-line position) following the list marker.
When at the start of a paragraph after a list paragraph, let the Tab key generate that same indent (creating a continuation list paragraph).
When the previous line is the first line of a blockquote, copy the indentation including the > up to the column of the first non-whitespace character (if any, else the end-of-line position) following the >.
Example for 1:
This is a regular line.
This is a code block; if I press Enter here
the result should be this.
This is a code block; if I press Enter here
instead of this.
Example for 2:
1. This is a list paragraph
spanning two lines.
This is a nested code block; if I press Enter twice here,
the result should be this.
instead of this.
Example for 3:
1. This is the first line of a list paragraph; if I press Enter here
the result should be this.
1. This is the first line of a list paragraph; if I press Enter here
instead of this.
Example for 4:
* This is the first paragraph of a list item,
spanning two lines. If I press Enter twice and then Tab, the result should be:
Like this, i.e. a second paragraph within the list item.
...instead of this, an indentation using the tab width.
Example for 5:
> This is the first line of a blockquote; if I press Enter here
> the result should be this.
> This is the first line of a blockquote; if I press Enter here
instead of this.
Smart indentation support for lists etc. would be nice. More specifically:
>
up to the column of the first non-whitespace character (if any, else the end-of-line position) following the>
.Example for 1:
Example for 2:
Example for 3:
Example for 4:
Example for 5: