Skip to content

Commit

Permalink
Clarify.
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnlaan committed Jun 16, 2024
1 parent 750e490 commit 8c1b3af
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Components/ScintEdit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1289,14 +1289,13 @@ function TScintEdit.ReplaceTextRange(const StartPos, EndPos: Integer;
end;

procedure TScintEdit.RestyleLine(const Line: Integer);
var
StartPos, EndPos, EndStyledPos: Integer;
begin
StartPos := GetPositionFromLine(Line);
EndPos := GetPositionFromLine(Line + 1);
{ Back up the 'last styled position' if necessary }
EndStyledPos := Call(SCI_GETENDSTYLED, 0, 0);
if StartPos < EndStyledPos then
var StartPos := GetPositionFromLine(Line);
var EndPos := GetPositionFromLine(Line + 1);
{ Back up the 'last styled position' if necessary using SCI_STARTSTYLINE
(SCI_SETENDSTYLED would have been a clearer name because setting the
'last styled position' is all it does }
if StartPos < Call(SCI_GETENDSTYLED, 0, 0) then
Call(SCI_STARTSTYLING, StartPos, 0);
StyleNeeded(EndPos);
end;
Expand Down

0 comments on commit 8c1b3af

Please sign in to comment.