From dfd83df76e9d41cdd1912b09832968697e5e7bc8 Mon Sep 17 00:00:00 2001 From: Matt Parker <61717342+MattParkerDev@users.noreply.github.com> Date: Mon, 18 Aug 2025 20:35:47 +1000 Subject: [PATCH] display 0 width diagnostics --- src/SharpIDE.Godot/SharpIdeCodeEdit.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/SharpIDE.Godot/SharpIdeCodeEdit.cs b/src/SharpIDE.Godot/SharpIdeCodeEdit.cs index 04c10db..b7453e6 100644 --- a/src/SharpIDE.Godot/SharpIdeCodeEdit.cs +++ b/src/SharpIDE.Godot/SharpIdeCodeEdit.cs @@ -120,7 +120,7 @@ public partial class SharpIdeCodeEdit : CodeEdit if (line < 0 || line >= GetLineCount()) return; - if (caretStartCol >= caretEndCol) // nothing to draw + if (caretStartCol > caretEndCol) // something went wrong return; // Clamp columns to line length @@ -142,12 +142,16 @@ public partial class SharpIdeCodeEdit : CodeEdit var endPos = endRect.End; startPos.Y -= 3; endPos.Y -= 3; + if (caretStartCol == caretEndCol) + { + endPos.X += 10; + } DrawDashedLine(startPos, endPos, color, thickness); //DrawLine(startPos, endPos, color, thickness); } public override void _Draw() { - UnderlineRange(_currentLine, _selectionStartCol, _selectionEndCol, new Color(1, 0, 0)); + //UnderlineRange(_currentLine, _selectionStartCol, _selectionEndCol, new Color(1, 0, 0)); foreach (var (fileSpan, diagnostic) in _diagnostics) { if (diagnostic.Location.IsInSource)