Skip to content

Commit

Permalink
Fix/cleanup SelectAndEnsureVisible.
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnlaan committed Jun 16, 2024
1 parent 7c3e9ea commit 1d33c96
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Components/ScintEdit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1328,9 +1328,8 @@ procedure TScintEdit.SelectAndEnsureVisible(const Range: TScintRange);
{ If the range is in a collapsed section, expand it }
var StartLine := GetLineFromPosition(Range.StartPos);
var EndLine := GetLineFromPosition(Range.EndPos);
EnsureLineVisible(StartLine);
if EndLine <> StartLine then
EnsureLineVisible(EndLine);
for var Line := StartLine to EndLine do
EnsureLineVisible(Line);

{ Select }
Selection := Range;
Expand Down

0 comments on commit 1d33c96

Please sign in to comment.