markdown-mode icon indicating copy to clipboard operation
markdown-mode copied to clipboard

Shift-Tab in a list should demote the current list item

Open MyriaCore opened this issue 4 years ago • 0 comments

If the mark is in a list of some sort, <backtab> should demote that list element.

- text
- more text
  - child text
  - █
- text
- more text
  - child text
- █

If the bullet styles are different between the different levels, the demoted bullet type should be changed:

- text
- more text
  * child text
  * █
- text
- more text
  * child text
- █

If the bullet types are different between the different levels, the demoted bullet type should be changed:

Caveats

For this to be usable, we should definitely make sure we parse list items correctly. Currently, any wite

- text
- more text
  1. child text
  2. █
- text
- more text
  1. child text
- █

If the bullet is at the last level, demotion should take it away from the bullet:

- text
- more text
- child text
- █
- text
- more text
  1. child text

█

This behavior might lead to typing mistakes, so it should be optional with a variable that controls for it.

Caveats

For this to be usable, we should make sure the parser recognizes same-indentation newlines as part of the list item. For example:

- List Item
- This list item is
  multiline. Everything I'm typing
  right now is still part of the list item.
- This list item has  multiple paragraphs.

  This paragraph is still part of the preceding
  list item. you can tall because the indentation
  of the list item is preserved.
- This list item has a code block as its second paragraph:
  
  ```
  there is code here
  it is part of the list item
  ```

MyriaCore avatar Nov 20 '20 17:11 MyriaCore