mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 14:01:49 +02:00
IDE: pass BlockTabIndent to codetools
git-svn-id: trunk@40791 -
This commit is contained in:
parent
501b3263a0
commit
f4cb4fec12
@ -116,6 +116,7 @@ type
|
|||||||
FSourceExtensions: string; // default is '.pp;.pas;.lpr;.dpr;.dpk'
|
FSourceExtensions: string; // default is '.pp;.pas;.lpr;.dpr;.dpk'
|
||||||
FPascalTools: TAVLTree; // tree of TCustomCodeTool sorted TCustomCodeTool(Data).Scanner.MainCode
|
FPascalTools: TAVLTree; // tree of TCustomCodeTool sorted TCustomCodeTool(Data).Scanner.MainCode
|
||||||
FTabWidth: integer;
|
FTabWidth: integer;
|
||||||
|
FUseTabs: boolean;
|
||||||
FVisibleEditorLines: integer;
|
FVisibleEditorLines: integer;
|
||||||
FWriteExceptions: boolean;
|
FWriteExceptions: boolean;
|
||||||
FWriteLockCount: integer;// Set/Unset counter
|
FWriteLockCount: integer;// Set/Unset counter
|
||||||
@ -140,6 +141,7 @@ type
|
|||||||
procedure SetCompleteProperties(const AValue: boolean);
|
procedure SetCompleteProperties(const AValue: boolean);
|
||||||
procedure SetIndentSize(NewValue: integer);
|
procedure SetIndentSize(NewValue: integer);
|
||||||
procedure SetTabWidth(const AValue: integer);
|
procedure SetTabWidth(const AValue: integer);
|
||||||
|
procedure SetUseTabs(AValue: boolean);
|
||||||
procedure SetVisibleEditorLines(NewValue: integer);
|
procedure SetVisibleEditorLines(NewValue: integer);
|
||||||
procedure SetJumpCentered(NewValue: boolean);
|
procedure SetJumpCentered(NewValue: boolean);
|
||||||
procedure SetCursorBeyondEOL(NewValue: boolean);
|
procedure SetCursorBeyondEOL(NewValue: boolean);
|
||||||
@ -274,6 +276,7 @@ type
|
|||||||
property VisibleEditorLines: integer
|
property VisibleEditorLines: integer
|
||||||
read FVisibleEditorLines write SetVisibleEditorLines;
|
read FVisibleEditorLines write SetVisibleEditorLines;
|
||||||
property TabWidth: integer read FTabWidth write SetTabWidth;
|
property TabWidth: integer read FTabWidth write SetTabWidth;
|
||||||
|
property UseTabs: boolean read FUseTabs write SetUseTabs;
|
||||||
property CompleteProperties: boolean
|
property CompleteProperties: boolean
|
||||||
read FCompleteProperties write SetCompleteProperties;
|
read FCompleteProperties write SetCompleteProperties;
|
||||||
property AddInheritedCodeToOverrideMethod: boolean
|
property AddInheritedCodeToOverrideMethod: boolean
|
||||||
@ -5414,6 +5417,13 @@ begin
|
|||||||
Indenter.DefaultTabWidth:=AValue;
|
Indenter.DefaultTabWidth:=AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TCodeToolManager.SetUseTabs(AValue: boolean);
|
||||||
|
begin
|
||||||
|
if FUseTabs=AValue then Exit;
|
||||||
|
FUseTabs:=AValue;
|
||||||
|
SourceChangeCache.BeautifyCodeOptions.UseTabs:=UseTabs;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCodeToolManager.SetVisibleEditorLines(NewValue: integer);
|
procedure TCodeToolManager.SetVisibleEditorLines(NewValue: integer);
|
||||||
begin
|
begin
|
||||||
if NewValue=FVisibleEditorLines then exit;
|
if NewValue=FVisibleEditorLines then exit;
|
||||||
|
@ -68,7 +68,7 @@ uses
|
|||||||
EnvironmentOpts, EditorOptions, CompilerOptions, KeyMapping, IDEProcs,
|
EnvironmentOpts, EditorOptions, CompilerOptions, KeyMapping, IDEProcs,
|
||||||
Debugger, IDEOptionDefs, CodeToolsDefines, Splash, Designer,
|
Debugger, IDEOptionDefs, CodeToolsDefines, Splash, Designer,
|
||||||
SourceEditor, BuildManager, FindInFilesDlg,
|
SourceEditor, BuildManager, FindInFilesDlg,
|
||||||
MainBar, MainIntf, PseudoTerminalDlg;
|
MainBar, MainIntf, SourceSynEditor, PseudoTerminalDlg;
|
||||||
|
|
||||||
type
|
type
|
||||||
TResetToolFlag = (
|
TResetToolFlag = (
|
||||||
@ -332,6 +332,8 @@ end;
|
|||||||
function TMainIDEBase.BeginCodeTool(ADesigner: TDesigner;
|
function TMainIDEBase.BeginCodeTool(ADesigner: TDesigner;
|
||||||
var ActiveSrcEdit: TSourceEditor; out ActiveUnitInfo: TUnitInfo;
|
var ActiveSrcEdit: TSourceEditor; out ActiveUnitInfo: TUnitInfo;
|
||||||
Flags: TCodeToolsFlags): boolean;
|
Flags: TCodeToolsFlags): boolean;
|
||||||
|
var
|
||||||
|
Edit: TIDESynEditor;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
if (ctfUseGivenSourceEditor in Flags) and (Project1<>nil)
|
if (ctfUseGivenSourceEditor in Flags) and (Project1<>nil)
|
||||||
@ -370,13 +372,16 @@ begin
|
|||||||
// init codetools
|
// init codetools
|
||||||
SaveSourceEditorChangesToCodeCache(nil);
|
SaveSourceEditorChangesToCodeCache(nil);
|
||||||
if ActiveSrcEdit<>nil then begin
|
if ActiveSrcEdit<>nil then begin
|
||||||
CodeToolBoss.VisibleEditorLines:=ActiveSrcEdit.EditorComponent.LinesInWindow;
|
Edit:=ActiveSrcEdit.EditorComponent;
|
||||||
CodeToolBoss.TabWidth:=ActiveSrcEdit.EditorComponent.TabWidth;
|
CodeToolBoss.VisibleEditorLines:=Edit.LinesInWindow;
|
||||||
CodeToolBoss.IndentSize:=ActiveSrcEdit.EditorComponent.BlockIndent;
|
CodeToolBoss.TabWidth:=Edit.TabWidth;
|
||||||
|
CodeToolBoss.IndentSize:=Edit.BlockIndent+Edit.BlockTabIndent*Edit.TabWidth;
|
||||||
|
CodeToolBoss.UseTabs:=Edit.BlockTabIndent>0;
|
||||||
end else begin
|
end else begin
|
||||||
CodeToolBoss.VisibleEditorLines:=25;
|
CodeToolBoss.VisibleEditorLines:=25;
|
||||||
CodeToolBoss.TabWidth:=EditorOpts.TabWidth;
|
CodeToolBoss.TabWidth:=EditorOpts.TabWidth;
|
||||||
CodeToolBoss.IndentSize:=EditorOpts.BlockIndent;
|
CodeToolBoss.IndentSize:=EditorOpts.BlockIndent+EditorOpts.BlockTabIndent*EditorOpts.TabWidth;
|
||||||
|
CodeToolBoss.UseTabs:=EditorOpts.BlockTabIndent>0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if ctfActivateAbortMode in Flags then
|
if ctfActivateAbortMode in Flags then
|
||||||
|
Loading…
Reference in New Issue
Block a user