mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 23:59:12 +02:00
SynEdit: add ViewToTextIndexEx / rename param for TextIndexToView...
git-svn-id: trunk@63201 -
This commit is contained in:
parent
34099573b4
commit
88b4e037a4
@ -218,10 +218,9 @@ type
|
|||||||
function GetLinesCount: Integer; virtual;
|
function GetLinesCount: Integer; virtual;
|
||||||
function GetDrawDividerInfo: TSynDividerDrawConfigSetting; virtual;
|
function GetDrawDividerInfo: TSynDividerDrawConfigSetting; virtual;
|
||||||
|
|
||||||
function TextToViewIndex(AIndex: TLineIdx): TLineRange; virtual;
|
function TextToViewIndex(ATextIndex: TLineIdx): TLineRange; virtual;
|
||||||
function ViewToTextIndex(AIndex: TLineIdx): TLineIdx; virtual;
|
function ViewToTextIndex(AViewIndex: TLineIdx): TLineIdx; virtual;
|
||||||
//function ViewToTextIndexEx(AIndex: TLineIdx; out AScreenRange: TLineRange): TLineIdx;
|
function ViewToTextIndexEx(AViewIndex: TLineIdx; out AViewRange: TLineRange): TLineIdx; virtual;
|
||||||
// todo: gutter info
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TLazSynDisplayViewEx }
|
{ TLazSynDisplayViewEx }
|
||||||
@ -622,14 +621,20 @@ begin
|
|||||||
Result.Color := clNone;
|
Result.Color := clNone;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TLazSynDisplayView.TextToViewIndex(AIndex: TLineIdx): TLineRange;
|
function TLazSynDisplayView.TextToViewIndex(ATextIndex: TLineIdx): TLineRange;
|
||||||
begin
|
begin
|
||||||
Result := NextView.TextToViewIndex(AIndex);
|
Result := NextView.TextToViewIndex(ATextIndex);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TLazSynDisplayView.ViewToTextIndex(AIndex: TLineIdx): TLineIdx;
|
function TLazSynDisplayView.ViewToTextIndex(AViewIndex: TLineIdx): TLineIdx;
|
||||||
begin
|
begin
|
||||||
Result := NextView.ViewToTextIndex(AIndex);
|
Result := NextView.ViewToTextIndex(AViewIndex);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TLazSynDisplayView.ViewToTextIndexEx(AViewIndex: TLineIdx; out
|
||||||
|
AViewRange: TLineRange): TLineIdx;
|
||||||
|
begin
|
||||||
|
Result := NextView.ViewToTextIndexEx(AViewIndex, AViewRange);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TSynLogicalPhysicalConvertor }
|
{ TSynLogicalPhysicalConvertor }
|
||||||
|
@ -358,8 +358,9 @@ type
|
|||||||
function GetNextHighlighterToken(out ATokenInfo: TLazSynDisplayTokenInfo): Boolean; override;
|
function GetNextHighlighterToken(out ATokenInfo: TLazSynDisplayTokenInfo): Boolean; override;
|
||||||
function GetLinesCount: Integer; override;
|
function GetLinesCount: Integer; override;
|
||||||
|
|
||||||
function TextToViewIndex(AIndex: TLineIdx): TLineRange; override;
|
function TextToViewIndex(ATextIndex: TLineIdx): TLineRange; override;
|
||||||
function ViewToTextIndex(AIndex: TLineIdx): TLineIdx; override;
|
function ViewToTextIndex(AViewIndex: TLineIdx): TLineIdx; override;
|
||||||
|
function ViewToTextIndexEx(AViewIndex: TLineIdx; out AViewRange: TLineRange): TLineIdx; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TSynTextFoldedView
|
{ TSynTextFoldedView
|
||||||
@ -832,10 +833,10 @@ begin
|
|||||||
Result := FFoldView.ViewedCount;
|
Result := FFoldView.ViewedCount;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TLazSynDisplayFold.TextToViewIndex(AIndex: TLineIdx): TLineRange;
|
function TLazSynDisplayFold.TextToViewIndex(ATextIndex: TLineIdx): TLineRange;
|
||||||
begin
|
begin
|
||||||
// TODO: inherited AFTER fold mapping?
|
// TODO: inherited AFTER fold mapping?
|
||||||
Result := inherited TextToViewIndex(AIndex);
|
Result := inherited TextToViewIndex(ATextIndex);
|
||||||
if Result.Top = Result.Bottom then begin
|
if Result.Top = Result.Bottom then begin
|
||||||
Result.Top := FFoldView.InternTextToViewIndex(Result.Top);
|
Result.Top := FFoldView.InternTextToViewIndex(Result.Top);
|
||||||
Result.Bottom := Result.Top;
|
Result.Bottom := Result.Top;
|
||||||
@ -846,9 +847,15 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TLazSynDisplayFold.ViewToTextIndex(AIndex: TLineIdx): TLineIdx;
|
function TLazSynDisplayFold.ViewToTextIndex(AViewIndex: TLineIdx): TLineIdx;
|
||||||
begin
|
begin
|
||||||
Result := FFoldView.InternViewToTextIndex(inherited ViewToTextIndex(AIndex));
|
Result := FFoldView.InternViewToTextIndex(inherited ViewToTextIndex(AViewIndex));
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TLazSynDisplayFold.ViewToTextIndexEx(AViewIndex: TLineIdx; out
|
||||||
|
AViewRange: TLineRange): TLineIdx;
|
||||||
|
begin
|
||||||
|
Result := FFoldView.InternViewToTextIndex(inherited ViewToTextIndexEx(AViewIndex, AViewRange));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TSynEditFoldExportStream }
|
{ TSynEditFoldExportStream }
|
||||||
|
@ -131,8 +131,9 @@ type
|
|||||||
function GetDrawDividerInfo: TSynDividerDrawConfigSetting; override;
|
function GetDrawDividerInfo: TSynDividerDrawConfigSetting; override;
|
||||||
function GetLinesCount: Integer; override;
|
function GetLinesCount: Integer; override;
|
||||||
|
|
||||||
function TextToViewIndex(AIndex: TLineIdx): TLineRange; override;
|
function TextToViewIndex(ATextIndex: TLineIdx): TLineRange; override;
|
||||||
function ViewToTextIndex(AIndex: TLineIdx): TLineIdx; override;
|
function ViewToTextIndex(AViewIndex: TLineIdx): TLineIdx; override;
|
||||||
|
function ViewToTextIndexEx(AViewIndex: TLineIdx; out AViewRange: TLineRange): TLineIdx; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TSynEditStringList }
|
{ TSynEditStringList }
|
||||||
@ -414,15 +415,23 @@ begin
|
|||||||
Result := FBuffer.Count;
|
Result := FBuffer.Count;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TLazSynDisplayBuffer.TextToViewIndex(AIndex: TLineIdx): TLineRange;
|
function TLazSynDisplayBuffer.TextToViewIndex(ATextIndex: TLineIdx): TLineRange;
|
||||||
begin
|
begin
|
||||||
Result.Top := AIndex;
|
Result.Top := ATextIndex;
|
||||||
Result.Bottom := AIndex;
|
Result.Bottom := ATextIndex;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TLazSynDisplayBuffer.ViewToTextIndex(AIndex: TLineIdx): TLineIdx;
|
function TLazSynDisplayBuffer.ViewToTextIndex(AViewIndex: TLineIdx): TLineIdx;
|
||||||
begin
|
begin
|
||||||
Result := AIndex;
|
Result := AViewIndex;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function TLazSynDisplayBuffer.ViewToTextIndexEx(AViewIndex: TLineIdx; out
|
||||||
|
AViewRange: TLineRange): TLineIdx;
|
||||||
|
begin
|
||||||
|
Result := AViewIndex;
|
||||||
|
AViewRange.Top := AViewIndex;
|
||||||
|
AViewRange.Bottom := AViewIndex;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TSynEditUndoTxtInsert }
|
{ TSynEditUndoTxtInsert }
|
||||||
|
Loading…
Reference in New Issue
Block a user