A DESCRIPTION OF THE PROBLEM :
Currently, CodeArea updates RichParagraph using the SyntaxDecorator#createRichParagraph(CodeTextModel ctm, int i) method even when it's completely unnecessary.
For example, consider a CodeArea with 1000 paragraphs and a visible area of 10 paragraphs. If the user modifies just one visible paragraph (e.g., by adding an 'A' character), CodeArea will recreate (via the createRichParagraph method) approximately 120-220 paragraphs depending on the modified paragraph's position. This seems excessive to me. After all, we're talking about a model - why create new paragraph instances every time when they haven't been modified?
Therefore, I propose that the createRichParagraph method should only be called when absolutely necessary, such as:
1. For initial paragraph creation
2. For creating a new version of a paragraph when it has been modified by the user
3. When code-generated events indicate paragraph changes, style modifications, etc.
Currently, CodeArea updates RichParagraph using the SyntaxDecorator#createRichParagraph(CodeTextModel ctm, int i) method even when it's completely unnecessary.
For example, consider a CodeArea with 1000 paragraphs and a visible area of 10 paragraphs. If the user modifies just one visible paragraph (e.g., by adding an 'A' character), CodeArea will recreate (via the createRichParagraph method) approximately 120-220 paragraphs depending on the modified paragraph's position. This seems excessive to me. After all, we're talking about a model - why create new paragraph instances every time when they haven't been modified?
Therefore, I propose that the createRichParagraph method should only be called when absolutely necessary, such as:
1. For initial paragraph creation
2. For creating a new version of a paragraph when it has been modified by the user
3. When code-generated events indicate paragraph changes, style modifications, etc.