Fixed IC10 ouput window, refactored IC10 highlighting
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user