Skip to content

Commit

Permalink
fixing crash in Alexey-T/CudaText#2924
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-T committed Oct 19, 2020
1 parent 9cee5b9 commit d19e7a4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions atsynedit/atsynedit_carets.inc
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ var
begin
Result.X:= -1;
Result.Y:= -1;
if not AStrings.IsIndexValid(P.Y) then Exit;

AWrapInfo.FindIndexesOfLineNumber(P.Y, NIndex1, NIndex2);
if NIndex1<0 then Exit;
Expand Down Expand Up @@ -349,6 +350,8 @@ begin
Item:= AWrapInfo[NIndex];
Result.Y:= Item.NLineIndex;
Result.X:= Item.NCharIndex+Item.NLength-1;
if not AStrings.IsIndexValid(Result.Y) then
exit(Point(-1, -1));
end;
Exit
end;
Expand All @@ -357,6 +360,8 @@ begin
//click in text
Item:= AWrapInfo[NIndex];
Result.Y:= Item.NLineIndex;
if not AStrings.IsIndexValid(Result.Y) then
exit(Point(-1, -1));

Str:= AStrings.LineSub(
Result.Y,
Expand Down

0 comments on commit d19e7a4

Please sign in to comment.