You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this gnarly little bit of code in Blitz Search with a Todo Note to bug AvaloniaEdit about it..
I have noticed ScrollTo not resolving if I set the text document, and immediately follow up with calling scroll to.
//I don't like this, Maybe we can work it into AvaloniaEdit itself "Load a document and center it on this line when things are finished"for(inti=0;i<2;i++){AvaloniaTextEditor.ScrollTo(lineNumer,1);try{varline=AvaloniaTextEditor.Document.GetLineByNumber(lineNumer);AvaloniaTextEditor.CaretOffset=line.Offset+column;}catch(ArgumentOutOfRangeExceptione){Console.WriteLine(e);break;}try{awaitTask.Delay(50,_currentToken.Token);}catch(OperationCanceledException){return;}if(_currentToken.IsCancellationRequested){break;}}AvaloniaTextEditor.TextArea.TextView.Redraw();}
The text was updated successfully, but these errors were encountered:
Probably you need to post setting the caret offset I to the Avalonia dispatcher to wait until the layout has finished and visual lines have been generated.
I'm somewhat familiar with the inner workings, but I am hoping to get some way to have to be less smart about that on the Editor itself. Can it do that automatically?
I have this gnarly little bit of code in Blitz Search with a Todo Note to bug AvaloniaEdit about it..
I have noticed ScrollTo not resolving if I set the text document, and immediately follow up with calling scroll to.
The text was updated successfully, but these errors were encountered: