Code Folding in a second TextEditor with the same TextDocument #398
Unanswered
SFrank1966
asked this question in
Q&A
Replies: 1 comment
-
I've found a solution for my problem. Two source code files need an addition. First I add another TextView to a FoldingManager with a new public method. Second in TextView.cs in method CreateAndMeasureVisualLines there should be code to handle collapsed lines. I will perform a pull request so that these changes will be part of the official release of AvalonEdit. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I use a TextEditor as the main document and another TextEditor as a code navigation window in scale 1 to 10. The Editors are using the same TextDocument. In the main Editor code folding is enabled via FoldingManager.Install(TextEditorMain.TextArea). After clicking on a code folding in the main Editor the second editor should also visualize the changes.
But if I try to enable code folding for the second TextEditor with another call to FoldingManager.Install(TextArea2), I get an Exception in FoldingElementGenerator.cs, method StartGeneration: ArgumentException("Invalid document").
When I look at the FoldingManager class, it seems that the class is able to handle one TextDocument and several TextViews. But there is no way to add another TextView from outside the class.
Any hints how I can visualize the changes after clicking on a code folding in the first editor also in the second editor?
Beta Was this translation helpful? Give feedback.
All reactions