Closed darius859 closed 1 year ago
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.
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.
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.