Fixed IC10 ouput window, refactored IC10 highlighting
All checks were successful
CI/CD Pipeline / test (pull_request) Successful in 33s
CI/CD Pipeline / build (pull_request) Has been skipped
CI/CD Pipeline / release (pull_request) Has been skipped

This commit is contained in:
2025-12-24 12:08:17 -07:00
parent c7aa30581d
commit 445f731170

View File

@@ -203,7 +203,6 @@ public class SlangFormatter : ICodeFormatter
Ic10Editor = new Editor(Editor.KeyHandler); Ic10Editor = new Editor(Editor.KeyHandler);
Ic10Editor.IsReadOnly = true; Ic10Editor.IsReadOnly = true;
iC10CodeFormatter.Editor = Ic10Editor; iC10CodeFormatter.Editor = Ic10Editor;
tab.ClearExtraEditors();
} }
if (tab.Editors.Count < 2) if (tab.Editors.Count < 2)
@@ -233,27 +232,15 @@ public class SlangFormatter : ICodeFormatter
var max = lines.Max(line => line.Ic10Line); var max = lines.Max(line => line.Ic10Line);
var min = lines.Min(line => line.Ic10Line); var min = lines.Min(line => line.Ic10Line);
Ic10Editor.CaretPos = new TextPosition { Col = 0, Line = (int)max };
// highlight all the IC10 lines that are within the specified range // highlight all the IC10 lines that are within the specified range
foreach (var index in Enumerable.Range((int)min, (int)(max - min) + 1)) Ic10Editor.Selection.Start = new TextPosition { Col = 0, Line = (int)min };
Ic10Editor.Selection.End = new TextPosition
{ {
var lineText = Ic10Editor.Lines[index].Text; Col = Ic10Editor.Lines[(int)max].Text.Length,
Line = (int)max,
var newLine = new StyledLine( };
lineText,
[
new SemanticToken
{
Column = 0,
Length = lineText.Length,
Line = index,
Background = ColorIdentifier,
Color = ColorFromHTML("black"),
},
]
);
Ic10Editor.Lines[index] = newLine;
}
} }
// This runs on the Main Thread // This runs on the Main Thread