From 445f731170905c24edd72b773d0d3e0eed61c7fc Mon Sep 17 00:00:00 2001 From: Devin Bidwell Date: Wed, 24 Dec 2025 12:08:17 -0700 Subject: [PATCH] Fixed IC10 ouput window, refactored IC10 highlighting --- csharp_mod/Formatter.cs | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/csharp_mod/Formatter.cs b/csharp_mod/Formatter.cs index 334403a..c07af8d 100644 --- a/csharp_mod/Formatter.cs +++ b/csharp_mod/Formatter.cs @@ -203,7 +203,6 @@ public class SlangFormatter : ICodeFormatter Ic10Editor = new Editor(Editor.KeyHandler); Ic10Editor.IsReadOnly = true; iC10CodeFormatter.Editor = Ic10Editor; - tab.ClearExtraEditors(); } if (tab.Editors.Count < 2) @@ -233,27 +232,15 @@ public class SlangFormatter : ICodeFormatter var max = lines.Max(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 - 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; - - var newLine = new StyledLine( - lineText, - [ - new SemanticToken - { - Column = 0, - Length = lineText.Length, - Line = index, - Background = ColorIdentifier, - Color = ColorFromHTML("black"), - }, - ] - ); - - Ic10Editor.Lines[index] = newLine; - } + Col = Ic10Editor.Lines[(int)max].Text.Length, + Line = (int)max, + }; } // This runs on the Main Thread