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

Incorrect second-level list renumbering on line delete #1155

Closed
minimusubi opened this issue Aug 8, 2022 · 4 comments
Closed

Incorrect second-level list renumbering on line delete #1155

minimusubi opened this issue Aug 8, 2022 · 4 comments
Labels
Area: List editing List editing: continuation, numbering, toggling, etc. Issue: Bug Res: Fixed Fix is checked in, but it might be a few weeks until a release.

Comments

@minimusubi
Copy link

Problem

An issue occurs with the automatic renumbering feature of ordered lists. When removing an entire line containing a top level list item, the automatic renumbering does not restart numbering between second level lists, and incorrectly "continues" the numbering instead.

At first glance, #668 appears as a related issue; however, I believe this is a separate issue.

How to reproduce

Start with this markdown:

1. Item to be deleted
2. First level 1
	1. Second level 1
	2. Second level 2
3. First level 2
	1. Second level 1
	2. Second level 2
3. First level 3
	1. Second level 1
	2. Second level 2

Then, delete the entire line containing Item to be deleted. Observe that the items within First level 2 and First level 3 are incorrectly numbered.
Expected output:

1. First level 1
	1. Second level 1
	2. Second level 2
2. First level 2
	1. Second level 1
	2. Second level 2
3. First level 3
	1. Second level 1
	2. Second level 2

Actual output:

1. First level 1
	1. Second level 1
	2. Second level 2
2. First level 2
	3. Second level 1
	4. Second level 2
3. First level 3
	5. Second level 1
	6. Second level 2

GIF Demonstration

Export

Configuration

Default. (Tested on fresh install of VS Code with only this extension installed)

Environment

  • Markdown All in One: 3.4.3
  • VS Code: 1.70.0 (user setup)
  • OS: Windows 10 Pro, Version 21H2, Build 19044.1826, 64-bit

Diagnostic data

No relevant messages in the developer console log.

@yzhang-gh
Copy link
Owner

You are right. That is a bug.

@yzhang-gh yzhang-gh added Issue: Bug Area: List editing List editing: continuation, numbering, toggling, etc. labels Aug 8, 2022
yzhang-gh pushed a commit that referenced this issue Aug 13, 2022
@yzhang-gh
Copy link
Owner

yzhang-gh commented Aug 13, 2022

Please try out the dev build.

yzhang-gh pushed a commit that referenced this issue Aug 13, 2022
@yzhang-gh yzhang-gh added the Res: Fixed Fix is checked in, but it might be a few weeks until a release. label Aug 14, 2022
yzhang-gh added a commit that referenced this issue Aug 20, 2022
* Add custom context key for the when key of onTabKey/onShiftTabKey command keybinding.

* Add prefix to custome context key name

* add context service layer

* create context service for markdown.extension.editor.cursor.inMarkdownList context

* put getting text later to avoid unnecessary computation

* handle context services as an array

* removed duplicated analyzing

* separate InFencedCode and InMathEnv contexts from InMarkdownList

* rename markdown.extension.editor.cursor.inMarkdownList to markdown.extension.editor.cursor.inList

* remove analyzation duplicating with when context

* fix a forgotten of 2nd previous commit

* merge context services to reduce duplicated callback handler and processing

* rename file names to kebab-case (responding https://markdown-all-in-one.github.io/docs/contributing/code-style/file.html)

* fix a mistake of 3rd previous commit

* 🚨 fix compiler warnings

* 🐛 #1155 renumber tab indented lists

* 🐛 regression since 432e134

* 🔇

(cherry picked from commit cb38589)
# to fix conflicts:
#     src/listEditing.ts

Co-authored-by: Yu Zhang <[email protected]>
@Naitreey
Copy link

Naitreey commented Mar 5, 2023

Hi @yzhang-gh , it looks like with the latest release (3.5.0) the bug is partially fixed. While the second-level numbered list renumbering works fine by now, the more deeply nested ones still break.

CleanShot 2023-03-05 at 17 56 56

yzhang-gh added a commit that referenced this issue Mar 5, 2023
@yzhang-gh
Copy link
Owner

Thanks. Please try out the latest dev build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: List editing List editing: continuation, numbering, toggling, etc. Issue: Bug Res: Fixed Fix is checked in, but it might be a few weeks until a release.
Projects
None yet
Development

No branches or pull requests

3 participants