Syntax highlighting and live spell check performance improvements
Ensure on opening a document that the Markdown AST is not being rebuilt for each block on a call to setPlainText() in QPlainTextEdit. Also set a default font for the editor via style sheet rather than applying a default format for each text block in the syntax highlighter. This ensures that the live spell check does not have to be called for the entire document after it is opened. Ensure on spell check rehighlight that it doesn't do a second rehighlight when the user types something (for example, after having toggled live spell check or another spell check setting). Finally, spread out HTML preview updates based on file size and when the user stops typing to prevent cmark-gfm from being called twice for each keystroke (for building the AST for the highlighter). A future improvement would be to prevent rebuilding the AST from scratch on each keystroke is desirable.
parent
201fd011
Please register or sign in to comment