added font.size to editor cache

This commit is contained in:
Basile Burg 2014-12-29 01:54:19 +01:00
parent 21894bffc0
commit 5db4627eff
1 changed files with 6 additions and 0 deletions

View File

@ -30,6 +30,7 @@ type
fFolds: TCollection;
fCaretPosition: Integer;
fSelectionEnd: Integer;
fFontSize: Integer;
fSourceFilename: string;
procedure setFolds(someFolds: TCollection);
published
@ -37,6 +38,7 @@ type
property sourceFilename: string read fSourceFilename write fSourceFilename;
property folds: TCollection read fFolds write setFolds;
property selectionEnd: Integer read fSelectionEnd write fSelectionEnd;
property fontSize: Integer read fFontSize write fFontSize;
public
constructor create(aComponent: TComponent); override;
destructor destroy; override;
@ -146,6 +148,7 @@ begin
fCaretPosition := fMemo.SelStart;
fSourceFilename := fMemo.fileName;
fSelectionEnd := fMemo.SelEnd;
fFontSize := fMemo.Font.Size;
//
// TODO-cEditor Cache: >nested< folding persistence
// cf. other ways: http://forum.lazarus.freepascal.org/index.php?topic=26748.msg164722#msg164722
@ -172,6 +175,9 @@ var
itm : TCEFoldCache;
begin
if fMemo = nil then exit;
//
if fFontSize > 0 then
fMemo.Font.Size := fFontSize;
// Currently collisions are not handled.
if fMemo.fileName <> fSourceFilename then exit;
//