Skip to content

Commit

Permalink
Merge branch 'main' into folding-poc
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnlaan committed Jun 16, 2024
2 parents 1ade41e + 8c1b3af commit a3277b2
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions Components/ScintEdit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ TScintEdit = class(TWinControl)
write SetAutoCompleteFontName;
property AutoCompleteFontSize: Integer read FAutoCompleteFontSize
write SetAutoCompleteFontSize default 0;
property ChangeHistory: Boolean read FChangeHistory write SetChangeHistory;
property ChangeHistory: Boolean read FChangeHistory write SetChangeHistory default False;
property CodePage: Integer read FCodePage write SetCodePage default CP_UTF8;
property Color;
property FillSelectionToEdge: Boolean read FFillSelectionToEdge write SetFillSelectionToEdge
Expand Down Expand Up @@ -1298,14 +1298,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 a3277b2

Please sign in to comment.