We have a SyntaxEditor component hooked up to a custom programmatic lexer. Document navigation is rather slow and it seems to be due to very large numbers of calls being made into the lexer.
For example, when Page Up is pressed at the bottom of a test document, the following pattern is observed:
- The visible region becomes lines 3182 to 3215.
- Lines 3182 to 3215 are requested to be lexed one at a time, as expected.
- Next lines 3183 to 3215 are requested, not expected.
- Repeat starting from earlier and earlier lines back to 3147 (approximately another page's worth of lines).
- The lexed range does not always include all lines up to 3215, sometimes stopping at 3182.
- In all almost 4000 lines are lexed.
It is difficult to track down what is responsible for requesting these lexing operations. Do you have any tips on why this might be happening and how we could track it down?