Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add smart indentation in editor #112

Open
nmatt opened this issue Jun 7, 2016 · 0 comments
Open

Add smart indentation in editor #112

nmatt opened this issue Jun 7, 2016 · 0 comments
Labels

Comments

@nmatt
Copy link

nmatt commented Jun 7, 2016

Smart indentation support for lists etc. would be nice.
More specifically:

  1. 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.
  2. 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.
  3. 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.
  4. When at the start of a paragraph after a list paragraph, let the Tab key generate that same indent (creating a continuation list paragraph).
  5. 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.
@madflow madflow added the rfc label Jun 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants