mirror of https://gitlab.com/basile.b/dexed.git
fix, AV in string ranges
This commit is contained in:
parent
1bd6099f10
commit
cea5cf757b
|
@ -24,7 +24,7 @@ inherited CEMessagesWidget: TCEMessagesWidget
|
|||
Width = 759
|
||||
Align = alClient
|
||||
BorderSpacing.Around = 2
|
||||
DefaultItemHeight = 18
|
||||
DefaultItemHeight = 16
|
||||
Font.Height = -12
|
||||
Font.Name = 'Courier New'
|
||||
Font.Quality = fqProof
|
||||
|
|
|
@ -1002,6 +1002,8 @@ begin
|
|||
rng.init(aMessg);
|
||||
while true do
|
||||
begin
|
||||
if rng.empty then
|
||||
break;
|
||||
idt := rng.popUntil(alp)^.takeWhile(alp).yield;
|
||||
if idt = '' then
|
||||
exit;
|
||||
|
@ -1017,11 +1019,14 @@ var
|
|||
lne: string;
|
||||
col: string = '';
|
||||
begin
|
||||
Result := Point(-1,-1);
|
||||
if aMessage.isEmpty then
|
||||
exit;
|
||||
rng.init(aMessage);
|
||||
rng.popUntil(['('])^.popWhile(['(']);
|
||||
rng.popUntil('(')^.popWhile('(');
|
||||
lne := rng.takeUntil([',', ':', ')']).yield;
|
||||
if rng.front in [',', ':'] then
|
||||
col := rng.popWhile([',', ':'])^.takeUntil([')']).yield;
|
||||
col := rng.popWhile([',', ':'])^.takeUntil(')').yield;
|
||||
result.y := strToIntDef(lne, -1);
|
||||
result.x := strToIntDef(col, -1);
|
||||
end;
|
||||
|
|
|
@ -97,6 +97,11 @@ end;
|
|||
|
||||
function TStringRange.init(const str: string): PStringRange;
|
||||
begin
|
||||
ptr := nil;
|
||||
pos := 0;
|
||||
len := 0;
|
||||
if str = '' then
|
||||
exit;
|
||||
ptr := @str[1];
|
||||
pos := 0;
|
||||
len := length(str);
|
||||
|
|
Loading…
Reference in New Issue