Skip to content

Commit

Permalink
Highlight errors where the fragment was not in the original text
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMpn committed Aug 24, 2024
1 parent e132d96 commit baec2dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MarkMpn.Sql4Cds.XTB/SqlQueryControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ private void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerComplet
var errorIndex = lines.Take(sql4CdsError.LineNumber - 1).Sum(l => l.Length + 1) + _params.Offset;
var errorLength = sql4CdsError.LineNumber > 0 ? lines[sql4CdsError.LineNumber - 1].Length : 0;

if (sql4CdsError.Fragment != null)
if (sql4CdsError.Fragment != null && sql4CdsError.Fragment.FragmentLength > 0)
{
errorIndex = _params.Offset + sql4CdsError.Fragment.StartOffset;
errorLength = sql4CdsError.Fragment.FragmentLength;
Expand Down

0 comments on commit baec2dc

Please sign in to comment.