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
If you type string x = @" and then paste some very big multi-line text, then ctrl+a and ctrl+x it will crash inside UpdateHighlightLineAsync
Here is my workaround, but I don't understand the code so I didn't send a pull request:
privateasyncvoidUpdateHighlightLineAsync(VersionedHighlightedLineline){try//added to catch a deleted documentLine{await Task.Run(async()=>{await initialDelayTask.ConfigureAwait(false); line.CancellationToken.ThrowIfCancellationRequested();vardocumentLine= line.DocumentLine;varcurrentVersion= Document.Version;if(line.Version ==null||!currentVersion.BelongsToSameDocumentAs(line.Version)|| currentVersion.CompareAge(line.Version)!=0){return;}varspans=await GetClassifiedSpansAsync(documentLine, line.CancellationToken).ConfigureAwait(false); line.CancellationToken.ThrowIfCancellationRequested();await TaskHelper.Run(()=>{try{if(line.CancellationToken.IsCancellationRequested){return;}varnewLineSections=newList<HighlightedSection>();foreach(var classifiedSpan in spans){if(IsOutsideLine(documentLine, classifiedSpan.TextSpan.Start, classifiedSpan.TextSpan.Length)){continue;} newLineSections.Add(new HighlightedSection{Color= CodeHighlightColors.GetHighlightingColor(classifiedSpan.ClassificationType),Offset= classifiedSpan.TextSpan.Start,Length= classifiedSpan.TextSpan.Length});}if(!line.Sections.SequenceEqual(newLineSections, HighlightedSectionComparer.Default)){ line.Sections.Clear();foreach(var newSection in newLineSections){ line.Sections.Add(newSection);}try{ HighlightingStateChanged?.Invoke(documentLine.LineNumber, documentLine.LineNumber);}catch(ArgumentOutOfRangeException)//this was the second exception, just swallow{}}}catch(InvalidOperationException){if(!documentLine.IsDeleted)//don't throw if the line is deletedthrow;}}, uiTaskScheduler).ConfigureAwait(false);}, line.CancellationToken);}catch(OperationCanceledException){}}
The text was updated successfully, but these errors were encountered:
If you type
string x = @"
and then paste some very big multi-line text, then ctrl+a and ctrl+x it will crash insideUpdateHighlightLineAsync
Here is my workaround, but I don't understand the code so I didn't send a pull request:
The text was updated successfully, but these errors were encountered: