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

Resets list numbering when editing a paragraph

Open denisbondar opened this issue 2 years ago • 2 comments

What's the problem

Removing a part of a paragraph that is an item in a numbered list resets the numbering of all other items to one.

What's the expected result

Do not change the numbering.

How to reproduce

  1. Create a multi-line numbered list
  2. Select and delete any word.
  3. All items below (sometimes including the current one) will be renumbered as "1"

Other information

https://github.com/yzhang-gh/vscode-markdown/assets/5622389/fcc019d9-145c-4183-a02f-564292bdfd86

denisbondar avatar Jun 20 '23 09:06 denisbondar

Thanks for the report.

You are right. The current list detection method will fail when the multi-line list item has no indentation. You may avoid this issue by adding indentation to the list item before we come up with a solution.

like this

1. one
   another one

2. two
   another two

...

yzhang-gh avatar Jul 02 '23 14:07 yzhang-gh

I encountered a similar behavior today. See in the following screenshots what happens to the "numbering" (it isn't numbering, it's dates 😊) when I delete the selected text.

Image

Image

mplattner avatar Jun 23 '25 09:06 mplattner