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

Blocks - Indenting makes the ordered list numbers change when indenting #158

Closed
DariusMuscalu opened this issue Oct 26, 2022 · 1 comment
Assignees

Comments

@DariusMuscalu
Copy link
Collaborator

DariusMuscalu commented Oct 26, 2022

When indenting a line in an ordered list, the lines below the one indented change their indexes to a number that doesn't make sense.
Screenshot 2022-10-26 224416

Duplicated by #56

Join on discord to get advice and help or follow us on YouTube Visual Coding to learn more about the architecture of Visual Editor and other Flutter apps.

@DariusMuscalu
Copy link
Collaborator Author

I solved it for code blocks too, because it was using the same component as the ordered list (NumberPoint). The issue was that when creating a new block of ordered lists or code blocks, the indentLevelWidth property which was passed by reference from the DocumentService, kept holding the last indent values of each line from the past block and thus starting with the last index when creating a new block and giving it that number (i.e If we had 4 lines in an ordered list, the next block of type ordered list / code block would start with the index 5 and so on). We had to reset the indentLevelWidth values when entering a new line while looping through the nodes in DocumentService.

One issue that is left is that when indenting to a roman number index, it keeps the above index, not resetting it.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants