Browse Source

Defer Title and SyntaxExtension until decompile actually lands

A cancelled decompile used to leave the tab title pointing at the new
node while the editor still showed the previous node's output. Move
Title and SyntaxExtension into the same UI-thread post that publishes
the rendered text, foldings, and highlighting model — so all five land
together when the decompile succeeds, and stay at the previous values
on cancel.

Assisted-by: Claude:claude-opus-4-7:Claude Code
pull/3755/head
Siegfried Pammer 2 months ago
parent
commit
c2998c2d75
  1. 5
      ILSpy/TextView/DecompilerTabPageModel.cs

5
ILSpy/TextView/DecompilerTabPageModel.cs

@ -115,8 +115,7 @@ namespace ILSpy.TextView @@ -115,8 +115,7 @@ namespace ILSpy.TextView
}
var nodeTitle = node.Text?.ToString() ?? "(unnamed)";
Title = nodeTitle;
SyntaxExtension = language.FileExtension;
var newSyntaxExtension = language.FileExtension;
IsDecompiling = true;
try
@ -149,6 +148,8 @@ namespace ILSpy.TextView @@ -149,6 +148,8 @@ namespace ILSpy.TextView
var model = output.HighlightingModel;
var collectedFoldings = output.Foldings;
await Dispatcher.UIThread.InvokeAsync(() => {
Title = nodeTitle;
SyntaxExtension = newSyntaxExtension;
HighlightingModel = model;
Foldings = collectedFoldings;
Text = rendered;

Loading…
Cancel
Save