Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a3277b2

Browse files
committedJun 16, 2024··
Merge branch 'main' into folding-poc
2 parents 1ade41e + 8c1b3af commit a3277b2

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed
 

‎Components/ScintEdit.pas

+7-8
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ TScintEdit = class(TWinControl)
337337
write SetAutoCompleteFontName;
338338
property AutoCompleteFontSize: Integer read FAutoCompleteFontSize
339339
write SetAutoCompleteFontSize default 0;
340-
property ChangeHistory: Boolean read FChangeHistory write SetChangeHistory;
340+
property ChangeHistory: Boolean read FChangeHistory write SetChangeHistory default False;
341341
property CodePage: Integer read FCodePage write SetCodePage default CP_UTF8;
342342
property Color;
343343
property FillSelectionToEdge: Boolean read FFillSelectionToEdge write SetFillSelectionToEdge
@@ -1298,14 +1298,13 @@ function TScintEdit.ReplaceTextRange(const StartPos, EndPos: Integer;
12981298
end;
12991299

13001300
procedure TScintEdit.RestyleLine(const Line: Integer);
1301-
var
1302-
StartPos, EndPos, EndStyledPos: Integer;
13031301
begin
1304-
StartPos := GetPositionFromLine(Line);
1305-
EndPos := GetPositionFromLine(Line + 1);
1306-
{ Back up the 'last styled position' if necessary }
1307-
EndStyledPos := Call(SCI_GETENDSTYLED, 0, 0);
1308-
if StartPos < EndStyledPos then
1302+
var StartPos := GetPositionFromLine(Line);
1303+
var EndPos := GetPositionFromLine(Line + 1);
1304+
{ Back up the 'last styled position' if necessary using SCI_STARTSTYLINE
1305+
(SCI_SETENDSTYLED would have been a clearer name because setting the
1306+
'last styled position' is all it does }
1307+
if StartPos < Call(SCI_GETENDSTYLED, 0, 0) then
13091308
Call(SCI_STARTSTYLING, StartPos, 0);
13101309
StyleNeeded(EndPos);
13111310
end;

0 commit comments

Comments
 (0)
Please sign in to comment.