mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-02 02:16:20 +02:00
SynEdit: Fix crash in highlighting code under QT (Bug #12951)
git-svn-id: trunk@18411 -
This commit is contained in:
parent
17299353b0
commit
a9764b3457
@ -3296,8 +3296,14 @@ var
|
||||
' Range=', PtrInt(FFoldedLinesView.Ranges[CurLine])
|
||||
]);
|
||||
DrawHiLightMarkupToken(nil, PChar(Pointer(sLine)), Length(sLine));
|
||||
end else begin
|
||||
end
|
||||
{$ELSE}
|
||||
if (FFoldedLinesView.Ranges[CurLine] = nil) then begin
|
||||
DrawHiLightMarkupToken(nil, PChar(Pointer(sLine)), Length(sLine));
|
||||
end
|
||||
{$ENDIF}
|
||||
else
|
||||
begin
|
||||
fHighlighter.SetRange(FFoldedLinesView.Ranges[CurLine]); //mh 2000-10-10
|
||||
fHighlighter.SetLine(sLine, FFoldedLinesView.TextIndex[CurLine]);
|
||||
// Try to concatenate as many tokens as possible to minimize the count
|
||||
@ -3315,9 +3321,7 @@ var
|
||||
// Let the highlighter scan the next token.
|
||||
fHighlighter.Next;
|
||||
end;
|
||||
{$IFDEF DEBUGSYNRANGE}
|
||||
end;
|
||||
{$ENDIF}
|
||||
end;
|
||||
// Draw anything that's left in the TokenAccu record. Fill to the end
|
||||
// of the invalid area with the correct colors.
|
||||
|
@ -1642,7 +1642,8 @@ end;
|
||||
(* Lines *)
|
||||
function TSynEditFoldedView.GetLines(index : Integer) : String;
|
||||
begin
|
||||
if (index < 0) or (index > fLinesInWindow) then exit('');
|
||||
if (index < 0) or (index > fLinesInWindow) then
|
||||
exit(fLines[ScreenLineToTextIndex(Index)]);
|
||||
Result := fLines[fTextIndexList[index]];
|
||||
end;
|
||||
|
||||
@ -1655,13 +1656,15 @@ end;
|
||||
|
||||
function TSynEditFoldedView.GetRange(Index : integer) : TSynEditRange;
|
||||
begin
|
||||
if (index < 0) or (index > fLinesInWindow) then exit(nil);
|
||||
if (index < 0) or (index > fLinesInWindow) then
|
||||
exit(fLines.Ranges[ScreenLineToTextIndex(Index)]);
|
||||
Result := fLines.Ranges[fTextIndexList[index]];
|
||||
end;
|
||||
|
||||
function TSynEditFoldedView.GetTextIndex(index : Integer) : Integer;
|
||||
begin
|
||||
if (index < 0) or (index > fLinesInWindow) then exit(-1);
|
||||
if (index < 0) or (index > fLinesInWindow) then
|
||||
exit(ScreenLineToTextIndex(Index));
|
||||
Result := fTextIndexList[index];
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user