tweaked getLineFromMessage() to allow dscanner "line:col" in addition to dmd "line,col"

This commit is contained in:
Basile Burg 2014-12-06 08:46:34 +01:00
parent f14b48da75
commit 10164ecae9
1 changed files with 5 additions and 4 deletions

View File

@ -98,7 +98,7 @@ type
end; end;
function guessMessageKind(const aMessg: string): TCEAppMessageKind; function guessMessageKind(const aMessg: string): TCEAppMessageKind;
function getLineFromDmdMessage(const aMessage: string): TPoint; function getLineFromMessage(const aMessage: string): TPoint;
function openFileFromDmdMessage(const aMessage: string): boolean; function openFileFromDmdMessage(const aMessage: string): boolean;
implementation implementation
@ -489,7 +489,7 @@ begin
if not openFileFromDmdMessage(msg) then if not openFileFromDmdMessage(msg) then
exit; exit;
// from here, since a doc has the focus, List.Selected is nil // from here, since a doc has the focus, List.Selected is nil
pos := getLineFromDmdMessage(msg); pos := getLineFromMessage(msg);
if fDoc = nil then if fDoc = nil then
exit; exit;
fDoc.CaretXY := pos; fDoc.CaretXY := pos;
@ -573,7 +573,7 @@ begin
end; end;
end; end;
function getLineFromDmdMessage(const aMessage: string): TPoint; function getLineFromMessage(const aMessage: string): TPoint;
var var
i, j: NativeInt; i, j: NativeInt;
ident: string; ident: string;
@ -597,7 +597,7 @@ begin
begin begin
inc(i); inc(i);
if i > length(aMessage) then exit; if i > length(aMessage) then exit;
while( isNumber(aMessage[i]) or (aMessage[i] = ',')) do while( isNumber(aMessage[i]) or (aMessage[i] = ',') or (aMessage[i] = ':')) do
begin begin
ident += aMessage[i]; ident += aMessage[i];
inc(i); inc(i);
@ -606,6 +606,7 @@ begin
if aMessage[i] = ')' then if aMessage[i] = ')' then
begin begin
j := Pos(',', ident); j := Pos(',', ident);
if j = 0 then j := Pos(':', ident);
if j = 0 then if j = 0 then
result.y := strToIntDef(ident, -1) result.y := strToIntDef(ident, -1)
else else