mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-11-04 02:19:29 +01:00 
			
		
		
		
	ideintf, ide: add InsertLine method
git-svn-id: trunk@36186 -
This commit is contained in:
		
							parent
							
								
									d46180aa2f
								
							
						
					
					
						commit
						0e0b2fa192
					
				@ -377,6 +377,7 @@ type
 | 
			
		||||
    function SelectionAvailable: boolean; override;
 | 
			
		||||
    function GetText(OnlySelection: boolean): string; override;
 | 
			
		||||
    procedure SelectText(const StartPos, EndPos: TPoint); override;
 | 
			
		||||
    procedure InsertLine(StartLine: Integer; const NewText: String; aKeepMarks: Boolean = False); override;
 | 
			
		||||
    procedure ReplaceLines(StartLine, EndLine: integer; const NewText: string; aKeepMarks: Boolean = False); override;
 | 
			
		||||
    procedure EncloseSelection;
 | 
			
		||||
    procedure UpperCaseSelection;
 | 
			
		||||
@ -4271,6 +4272,18 @@ Begin
 | 
			
		||||
  FEditor.BlockEnd := EndPos;
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TSourceEditor.InsertLine(StartLine: Integer; const NewText: String;
 | 
			
		||||
  aKeepMarks: Boolean);
 | 
			
		||||
const
 | 
			
		||||
  MarksMode: array[Boolean] of TSynMarksAdjustMode = (smaMoveUp, smaKeep);
 | 
			
		||||
begin
 | 
			
		||||
  if not ReadOnly then
 | 
			
		||||
    FEditor.SetTextBetweenPoints(
 | 
			
		||||
      Point(1, StartLine),
 | 
			
		||||
      Point(1, StartLine),
 | 
			
		||||
      NewText + LineEnding, [], scamEnd, MarksMode[aKeepMarks]);
 | 
			
		||||
end;
 | 
			
		||||
 | 
			
		||||
procedure TSourceEditor.ReplaceLines(StartLine, EndLine: integer;
 | 
			
		||||
  const NewText: string; aKeepMarks: Boolean = False);
 | 
			
		||||
const
 | 
			
		||||
 | 
			
		||||
@ -116,6 +116,7 @@ type
 | 
			
		||||
    function GetText(OnlySelection: boolean): string; virtual; abstract;
 | 
			
		||||
    procedure SelectText(LineNum, CharStart, LineNum2, CharEnd: Integer);
 | 
			
		||||
    procedure SelectText(const StartPos, EndPos: TPoint); virtual; abstract;
 | 
			
		||||
    procedure InsertLine(StartLine: Integer; const NewText: String; aKeepMarks: Boolean = False); virtual; abstract;
 | 
			
		||||
    procedure ReplaceLines(StartLine, EndLine: integer; const NewText: string; aKeepMarks: Boolean = False); virtual; abstract;
 | 
			
		||||
    procedure ReplaceText(const StartPos, EndPos: TPoint; const NewText: string);
 | 
			
		||||
    procedure AskReplace(Sender: TObject; const ASearch, AReplace: string;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user