FORMAT AND NAVIGATE

Hello Andrew,
I have two questions:
1) How can I format a document? I tried Source.FormatText() and RoslynParser.SmartFormat() but with no success. If I edit a line and press enter the line gets formatted, but how to format the whole document?
2) I want to implement forward/backward navigation like in Visual Studio (cursor jumps to last position). How to do this?
Thank you very much,
Andreas
Hi,
about 1: I use "mySyntaxEdit.Selection.SmartFormatDocument()".
Hope this helps
Wolfgang
thanks, that did the trick :-)
Hello Andreas,
Please refer to the sample demo here
https://drive.google.com/open?id=1WN0Z7W1a89qX1MAvI4ifGtOfhikkS1xK,
showing how to implement history, when you need to navigate to other location (like when you execute Goto Declaration command).

regards,
Andrew
Hello Andrew,
thanks - but the example didn't work. I understand that I have to track the history myself, but I miss the point where to track the history. Which event is best to build the history list? Something like a PositionChanged event. I tried SourceStateChanged, but it is not called on every position change. How else?
Greetings,
Andreas
sorry, I made a mistake, SourceStateChanged does the job correct. So thank you, everything fine now.