~ubuntu-branches/ubuntu/vivid/lazarus/vivid

« back to all changes in this revision

Viewing changes to ide/sourcesyneditor.pas

  • Committer: Package Import Robot
  • Author(s): Abou Al Montacir
  • Date: 2014-05-15 23:17:51 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20140515231751-gumj9a01g0ghm7ac
Tags: 1.2.2+dfsg-1
* New upstream release with few fixes and official support of FPC 2.6.4.
  - The detailed list of changes can be found here:
  http://wiki.lazarus.freepascal.org/Lazarus_1.2_fixes_branch#Fixes_for_1.2.2_.28Merged.29

Show diffs side-by-side

added added

removed removed

Lines of Context:
217
217
    FMarkupIfDef: TSourceSynEditMarkupIfDef;
218
218
    FTopInfoDisplay: TSourceLazSynTopInfoView;
219
219
    FTopInfoLastTopLine: Integer;
220
 
    FSrcSynCaretChangedLock: boolean;
 
220
    FSrcSynCaretChangedLock, FSrcSynCaretChangedNeeded: boolean;
221
221
    FExtraMarkupLine: TSynEditMarkupSpecialLine;
222
222
    FExtraMarkupMgr: TSynEditMarkupManager;
223
223
    FTopInfoMarkup: TSynSelectedColor;
233
233
    procedure SetHighlightUserWordCount(AValue: Integer);
234
234
    procedure SetShowTopInfo(AValue: boolean);
235
235
    procedure SetTopInfoMarkup(AValue: TSynSelectedColor);
 
236
    procedure DoHighlightChanged(Sender: TSynEditStrings; AIndex, ACount : Integer);
236
237
    procedure SrcSynCaretChanged(Sender: TObject);
237
238
  protected
238
239
    procedure DoOnStatusChange(Changes: TSynStatusChanges); override;
1346
1347
 
1347
1348
{ TIDESynEditor }
1348
1349
 
 
1350
procedure TIDESynEditor.DoHighlightChanged(Sender: TSynEditStrings; AIndex, ACount: Integer);
 
1351
begin
 
1352
  if FSrcSynCaretChangedNeeded then
 
1353
    SrcSynCaretChanged(nil);
 
1354
end;
 
1355
 
1349
1356
procedure TIDESynEditor.SrcSynCaretChanged(Sender: TObject);
1350
1357
  function RealTopLine: Integer;
1351
1358
  begin
1364
1371
  if (not FShowTopInfo) or (not HandleAllocated) or (TextView.HighLighter = nil) then exit;
1365
1372
  if FSrcSynCaretChangedLock or not(TextView.HighLighter is TSynPasSyn) then exit;
1366
1373
 
 
1374
  if TextView.HighLighter.NeedScan then begin
 
1375
    FSrcSynCaretChangedNeeded := True;
 
1376
    exit;
 
1377
  end;
 
1378
  FSrcSynCaretChangedNeeded := False;
 
1379
 
1367
1380
  FSrcSynCaretChangedLock := True;
1368
1381
  try
1369
1382
    ListCnt := 0;
1612
1625
  FTopInfoMarkup := TSynSelectedColor.Create;
1613
1626
  FTopInfoMarkup.Clear;
1614
1627
 
 
1628
  ViewedTextBuffer.AddChangeHandler(senrHighlightChanged, @DoHighlightChanged);
 
1629
 
1615
1630
  // Markup for top info hint
1616
1631
  FExtraMarkupLine := TSynEditMarkupSpecialLine.Create(Self);
1617
1632
  FExtraMarkupLine.OnSpecialLineMarkup  := @GetTopInfoMarkupForLine;