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

Mobile,Desktop: Fix #9200: Fix list renumbering and enable multiple selections #9506

Merged

Conversation

personalizedrefrigerator
Copy link
Collaborator

@personalizedrefrigerator personalizedrefrigerator commented Dec 12, 2023

Summary

This pull request does two things:

Testing plan

This pull request has an automated test. However, it can be tested manually by:

  1. Creating a numbered list:
1. this
2. is
3. a
4. test
5. of
6. lists
  1. Adding cursors to lines 2, 3, and 4:
  2. Pressing tab
  3. Removing all cursors, then adding cursors to lines 3 and 4
  4. Pressing tab
  5. Adding a cursor to just line 4 (remove the cursor from line 3)
  6. Pressing tab
  7. Adding a cursor to line 5
  8. Pressing shift-tab twice

After each step, each list should have the same numbering as it does in the viewer.

This has been successfully tested on Ubuntu 23.10.

Comment on lines +663 to +679
nextListNumber = parseInt(match[2], 10);

// Handle the case where we deindent multiple times. For example,
// 1. test
// 1. test
// 1. test
// 2. test
while (targetIndentLen > indentationLen) {
const listNumberRecord = listNumberStack.pop();

if (!listNumberRecord) {
break;
} else {
targetIndentLen = listNumberRecord.indentationLength;
nextListNumber = listNumberRecord.nextListNumber;
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure why this wasn't necessary to handle double de-indentation before.

I suspect previously sublists weren't renumbered with parent lists. However, selecting a parent list and pressing tab should have also caused sublists to be renumbered.

@laurent22 laurent22 merged commit a730d34 into laurent22:dev Dec 13, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants