fix: consecutive numbering fails after indented sub-bullets#7447
Merged
JohnMcLear merged 2 commits intoether:developfrom Apr 4, 2026
Merged
fix: consecutive numbering fails after indented sub-bullets#7447JohnMcLear merged 2 commits intoether:developfrom
JohnMcLear merged 2 commits intoether:developfrom
Conversation
The applyNumberList() function in renumberList() checked listType[0] === 'indent' but after regex exec, listType[0] is the full match (e.g., "indent1"), never just "indent". Changed to listType[1] which is the capture group containing just the type name. This caused indent-type lines to not be recognized during renumbering, breaking the numbering sequence when numbered lists followed indented content. Fixes ether#5718 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Review Summary by QodoFix consecutive numbering after indented sub-bullets
WalkthroughsDescription• Fix array index bug in applyNumberList() function - Changed listType[0] to listType[1] to correctly identify indent-type lines - After regex exec, listType[0] is full match, listType[1] is capture group • Add regression test for consecutive numbering after indented sub-bullets - Tests switching from bullet to numbered list after indented content - Verifies numbered items show correct consecutive numbers (1, 2, 3) Diagramflowchart LR
A["Regex exec result<br/>listType[0]=full match<br/>listType[1]=type name"] -- "Bug: checked listType[0]" --> B["Indent never recognized"]
B -- "Broken numbering<br/>all show 1" --> C["Issue #5718"]
A -- "Fix: check listType[1]" --> D["Indent correctly identified"]
D -- "Consecutive numbers<br/>1, 2, 3..." --> E["Fixed behavior"]
File Changes1. src/static/js/ace2_inner.ts
|
Code Review by Qodo
1.
|
- Assert .list-bullet2 exists after Tab to verify indent precondition - Remove waitForTimeout(500) since toHaveAttribute already waits 5s Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
One-character fix in
ace2_inner.ts:listType[0]→listType[1]in theapplyNumberList()function insiderenumberList().Root Cause
After
listType = /([a-z]+)([0-9]+)/.exec(listType), the array indices are:listType[0]= full match (e.g.,"indent1") — never just"indent"listType[1]= capture group 1 (e.g.,"indent","number","bullet")listType[2]= capture group 2 (e.g.,"1","2")The check
listType[0] === 'indent'was always false, so indent-type lines were never recognized during renumbering. This broke the numbering sequence when numbered lists followed indented content — all items showed "1" instead of incrementing.Note: the same function's parent
renumberList()correctly usestype[1] === 'indent'at lines 2290 and 2297 — this was just a typo in the innerapplyNumberList()helper.Test plan
Fixes #5718
🤖 Generated with Claude Code