SynEdit: formatting

git-svn-id: trunk@39092 -
This commit is contained in:
juha 2012-10-15 16:41:10 +00:00
parent ec95f00f98
commit b5b8a10263
3 changed files with 30 additions and 55 deletions

View File

@ -623,8 +623,7 @@ type
function GetBracketMatchColor : TSynSelectedColor; function GetBracketMatchColor : TSynSelectedColor;
function GetMouseLinkColor : TSynSelectedColor; function GetMouseLinkColor : TSynSelectedColor;
function GetTrimSpaceType: TSynEditStringTrimmingType; function GetTrimSpaceType: TSynEditStringTrimmingType;
procedure SetBracketHighlightStyle( procedure SetBracketHighlightStyle(const AValue: TSynEditBracketHighlightStyle);
const AValue: TSynEditBracketHighlightStyle);
procedure SetOnGutterClick(const AValue : TGutterClickEvent); procedure SetOnGutterClick(const AValue : TGutterClickEvent);
procedure SetSelectedColor(const AValue : TSynSelectedColor); procedure SetSelectedColor(const AValue : TSynSelectedColor);
procedure SetSpecialLineColors(const AValue : TSpecialLineColorsEvent); procedure SetSpecialLineColors(const AValue : TSpecialLineColorsEvent);
@ -967,8 +966,7 @@ type
function ScreenRowToRow(ScreenRow: integer; LimitToLines: Boolean = True): integer; function ScreenRowToRow(ScreenRow: integer; LimitToLines: Boolean = True): integer;
function RowToScreenRow(PhysicalRow: integer): integer; function RowToScreenRow(PhysicalRow: integer): integer;
procedure Notification(AComponent: TComponent; procedure Notification(AComponent: TComponent; Operation: TOperation); override;
Operation: TOperation); override;
procedure RegisterCommandHandler(AHandlerProc: THookedCommandEvent; procedure RegisterCommandHandler(AHandlerProc: THookedCommandEvent;
AHandlerData: pointer; AFlags: THookedCommandFlags = [hcfPreExec, hcfPostExec]); AHandlerData: pointer; AFlags: THookedCommandFlags = [hcfPreExec, hcfPostExec]);
procedure UnregisterCommandHandler(AHandlerProc: THookedCommandEvent); procedure UnregisterCommandHandler(AHandlerProc: THookedCommandEvent);
@ -1031,8 +1029,7 @@ type
property LeftChar: Integer read GetLeftChar write SetLeftChar; property LeftChar: Integer read GetLeftChar write SetLeftChar;
property LineHeight: integer read GetLineHeight; property LineHeight: integer read GetLineHeight;
property LinesInWindow: Integer read GetLinesInWindow; property LinesInWindow: Integer read GetLinesInWindow;
property MaxLeftChar: integer read fMaxLeftChar write SetMaxLeftChar property MaxLeftChar: integer read fMaxLeftChar write SetMaxLeftChar default 1024;
default 1024;
property TopLine: Integer read GetTopLine write SetTopLine; property TopLine: Integer read GetTopLine write SetTopLine;
property UseIncrementalColor : Boolean write SetUseIncrementalColor; property UseIncrementalColor : Boolean write SetUseIncrementalColor;
@ -1049,10 +1046,8 @@ type
property Plugin[Index: Integer]: TLazSynEditPlugin read GetPlugin; property Plugin[Index: Integer]: TLazSynEditPlugin read GetPlugin;
function MarkupCount: Integer; function MarkupCount: Integer;
property Markup[Index: integer]: TSynEditMarkup read GetMarkup; property Markup[Index: integer]: TSynEditMarkup read GetMarkup;
property MarkupByClass[Index: TSynEditMarkupClass]: TSynEditMarkup property MarkupByClass[Index: TSynEditMarkupClass]: TSynEditMarkup read GetMarkupByClass;
read GetMarkupByClass; property TrimSpaceType: TSynEditStringTrimmingType read GetTrimSpaceType write SetTrimSpaceType;
property TrimSpaceType: TSynEditStringTrimmingType
read GetTrimSpaceType write SetTrimSpaceType;
public public
// Caret // Caret
property InsertCaret: TSynEditCaretType read FInsertCaret write SetInsertCaret default ctVerticalLine; property InsertCaret: TSynEditCaretType read FInsertCaret write SetInsertCaret default ctVerticalLine;
@ -1082,21 +1077,16 @@ type
property Highlighter: TSynCustomHighlighter read fHighlighter write SetHighlighter; property Highlighter: TSynCustomHighlighter read fHighlighter write SetHighlighter;
property Gutter: TSynGutter read FLeftGutter write SetGutter; property Gutter: TSynGutter read FLeftGutter write SetGutter;
property RightGutter: TSynGutter read FRightGutter write SetRightGutter; property RightGutter: TSynGutter read FRightGutter write SetRightGutter;
property InsertMode: boolean read fInserting write SetInsertMode property InsertMode: boolean read fInserting write SetInsertMode default true;
default true; property Keystrokes: TSynEditKeyStrokes read FKeystrokes write SetKeystrokes;
property Keystrokes: TSynEditKeyStrokes property MouseActions: TSynEditMouseActions read GetMouseActions write SetMouseActions;
read FKeystrokes write SetKeystrokes; property MouseTextActions: TSynEditMouseActions read GetMouseTextActions write SetMouseTextActions;
property MouseActions: TSynEditMouseActions // Mouseactions, if mouse is over selection => fallback to normal
read GetMouseActions write SetMouseActions; property MouseSelActions: TSynEditMouseActions read GetMouseSelActions write SetMouseSelActions;
property MouseTextActions: TSynEditMouseActions
read GetMouseTextActions write SetMouseTextActions;
property MouseSelActions: TSynEditMouseActions // Mouseactions, if mouse is over selection => fallback to normal
read GetMouseSelActions write SetMouseSelActions;
property MaxUndo: Integer read GetMaxUndo write SetMaxUndo default 1024; property MaxUndo: Integer read GetMaxUndo write SetMaxUndo default 1024;
property Options: TSynEditorOptions read FOptions write SetOptions // See SYNEDIT_UNIMPLEMENTED_OPTIONS for deprecated Values // See SYNEDIT_UNIMPLEMENTED_OPTIONS for deprecated Values
default SYNEDIT_DEFAULT_OPTIONS; property Options: TSynEditorOptions read FOptions write SetOptions default SYNEDIT_DEFAULT_OPTIONS;
property Options2: TSynEditorOptions2 read FOptions2 write SetOptions2 property Options2: TSynEditorOptions2 read FOptions2 write SetOptions2 default SYNEDIT_DEFAULT_OPTIONS2;
default SYNEDIT_DEFAULT_OPTIONS2;
property MouseOptions: TSynEditorMouseOptions read FMouseOptions write SetMouseOptions property MouseOptions: TSynEditorMouseOptions read FMouseOptions write SetMouseOptions
default SYNEDIT_DEFAULT_MOUSE_OPTIONS; default SYNEDIT_DEFAULT_MOUSE_OPTIONS;
property ShareOptions: TSynEditorShareOptions read FShareOptions write SetShareOptions property ShareOptions: TSynEditorShareOptions read FShareOptions write SetShareOptions
@ -1105,8 +1095,7 @@ type
property ReadOnly: Boolean read GetReadOnly write SetReadOnly default FALSE; property ReadOnly: Boolean read GetReadOnly write SetReadOnly default FALSE;
property RightEdge: Integer read GetRightEdge write SetRightEdge default 80; property RightEdge: Integer read GetRightEdge write SetRightEdge default 80;
property RightEdgeColor: TColor read GetRightEdgeColor write SetRightEdgeColor default clSilver; property RightEdgeColor: TColor read GetRightEdgeColor write SetRightEdgeColor default clSilver;
property ScrollBars: TScrollStyle property ScrollBars: TScrollStyle read FScrollBars write SetScrollBars default ssBoth;
read FScrollBars write SetScrollBars default ssBoth;
property BracketHighlightStyle: TSynEditBracketHighlightStyle property BracketHighlightStyle: TSynEditBracketHighlightStyle
read GetBracketHighlightStyle write SetBracketHighlightStyle; read GetBracketHighlightStyle write SetBracketHighlightStyle;
property TabWidth: integer read fTabWidth write SetTabWidth default 8; property TabWidth: integer read fTabWidth write SetTabWidth default 8;
@ -2491,8 +2480,7 @@ begin
Result := FFoldedLinesView; Result := FFoldedLinesView;
end; end;
procedure TCustomSynEdit.SetBracketHighlightStyle( procedure TCustomSynEdit.SetBracketHighlightStyle(const AValue: TSynEditBracketHighlightStyle);
const AValue: TSynEditBracketHighlightStyle);
begin begin
fMarkupBracket.HighlightStyle := AValue; fMarkupBracket.HighlightStyle := AValue;
end; end;
@ -2507,8 +2495,7 @@ begin
fMarkupSelection.UseIncrementalColor:=AValue; fMarkupSelection.UseIncrementalColor:=AValue;
end; end;
function TCustomSynEdit.GetCharLen(const Line: string; CharStartPos: integer function TCustomSynEdit.GetCharLen(const Line: string; CharStartPos: integer): integer;
): integer;
begin begin
if UseUTF8 and (length(Line)>=CharStartPos) then if UseUTF8 and (length(Line)>=CharStartPos) then
Result:=UTF8CharacterLength(@Line[CharStartPos]) Result:=UTF8CharacterLength(@Line[CharStartPos])
@ -5751,8 +5738,7 @@ begin
end; end;
end; end;
procedure TCustomSynEdit.Notification(AComponent: TComponent; procedure TCustomSynEdit.Notification(AComponent: TComponent; Operation: TOperation);
Operation: TOperation);
begin begin
inherited Notification(AComponent, Operation); inherited Notification(AComponent, Operation);
if Operation = opRemove then begin if Operation = opRemove then begin

View File

@ -127,7 +127,7 @@ type
published published
property Shift: TShiftState read FShift write SetShift default []; property Shift: TShiftState read FShift write SetShift default [];
property ShiftMask: TShiftState read FShiftMask write SetShiftMask default []; property ShiftMask: TShiftState read FShiftMask write SetShiftMask default [];
property Button: TSynMouseButton read FButton write SetButton default mbXLeft; property Button: TSynMouseButton read FButton write SetButton default mbXLeft;
property ClickCount: TSynMAClickCount read FClickCount write SetClickCount default ccSingle; property ClickCount: TSynMAClickCount read FClickCount write SetClickCount default ccSingle;
property ClickDir: TSynMAClickDir read FClickDir write SetClickDir default cdUp; property ClickDir: TSynMAClickDir read FClickDir write SetClickDir default cdUp;
property Command: TSynEditorMouseCommand read FCommand write SetCommand; property Command: TSynEditorMouseCommand read FCommand write SetCommand;

View File

@ -10408,8 +10408,7 @@ begin
{$ENDIF} {$ENDIF}
LogCaret:=ActiveSrcEdit.EditorComponent.LogicalCaretXY; LogCaret:=ActiveSrcEdit.EditorComponent.LogicalCaretXY;
if CodeToolBoss.JumpToMethod(ActiveUnitInfo.Source, if CodeToolBoss.JumpToMethod(ActiveUnitInfo.Source,
LogCaret.X,LogCaret.Y, LogCaret.X,LogCaret.Y,NewSource,NewX,NewY,NewTopLine,RevertableJump) then
NewSource,NewX,NewY,NewTopLine,RevertableJump) then
begin begin
Flags := [jfFocusEditor]; Flags := [jfFocusEditor];
if not RevertableJump then include(Flags, jfAddJumpPoint); if not RevertableJump then include(Flags, jfAddJumpPoint);
@ -10517,9 +10516,7 @@ begin
if CodeToolsOpts.SkipForwardDeclarations then if CodeToolsOpts.SkipForwardDeclarations then
Include(FindFlags, fsfSkipClassForward); Include(FindFlags, fsfSkipClassForward);
if CodeToolBoss.FindDeclaration(ActiveUnitInfo.Source, if CodeToolBoss.FindDeclaration(ActiveUnitInfo.Source,
LogCaretXY.X,LogCaretXY.Y, LogCaretXY.X, LogCaretXY.Y, NewSource, NewX, NewY, NewTopLine, FindFlags )
NewSource,NewX,NewY,NewTopLine,FindFlags
)
then begin then begin
//debugln(['TMainIDE.DoFindDeclarationAtCaret ',NewSource.Filename,' NewX=',Newx,',y=',NewY,' ',NewTopLine]); //debugln(['TMainIDE.DoFindDeclarationAtCaret ',NewSource.Filename,' NewX=',Newx,',y=',NewY,' ',NewTopLine]);
DoJumpToCodePosition(ActiveSrcEdit, ActiveUnitInfo, DoJumpToCodePosition(ActiveSrcEdit, ActiveUnitInfo,
@ -10643,8 +10640,7 @@ begin
// create the file list // create the file list
Files:=TStringList.Create; Files:=TStringList.Create;
Files.Add(TargetUnitInfo.Filename); Files.Add(TargetUnitInfo.Filename);
if CompareFilenames(DeclarationUnitInfo.Filename,TargetUnitInfo.Filename)<>0 if CompareFilenames(DeclarationUnitInfo.Filename,TargetUnitInfo.Filename)<>0 then
then
Files.Add(DeclarationUnitInfo.Filename); Files.Add(DeclarationUnitInfo.Filename);
Options:=MiscellaneousOptions.FindRenameIdentifierOptions; Options:=MiscellaneousOptions.FindRenameIdentifierOptions;
@ -11212,8 +11208,7 @@ begin
Project1.UpdateVisibleUnit(ASrcEdit, Project1.UpdateVisibleUnit(ASrcEdit,
SourceEditorManager.IndexOfSourceWindow(ASrcEdit.SourceNotebook)); SourceEditorManager.IndexOfSourceWindow(ASrcEdit.SourceNotebook));
ActiveUnitInfo := ActiveUnitInfo := Project1.UnitWithEditorComponent(SourceEditorManager.ActiveEditor);
Project1.UnitWithEditorComponent(SourceEditorManager.ActiveEditor);
if ActiveUnitInfo = nil then Exit; if ActiveUnitInfo = nil then Exit;
ActiveUnitInfo.SetLastUsedEditor(SourceEditorManager.ActiveEditor); ActiveUnitInfo.SetLastUsedEditor(SourceEditorManager.ActiveEditor);
@ -11737,8 +11732,7 @@ var
end; end;
// rename inherited component // rename inherited component
InheritedComponent:= InheritedComponent:=DependingUnit.Component.FindComponent(AComponent.Name);
DependingUnit.Component.FindComponent(AComponent.Name);
if InheritedComponent<>nil then begin if InheritedComponent<>nil then begin
// inherited component found // inherited component found
if FRenamingComponents=nil then if FRenamingComponents=nil then
@ -12225,8 +12219,7 @@ begin
DoViewJumpHistory(true); DoViewJumpHistory(true);
end; end;
procedure TMainIDE.OnSrcNoteBookPopupMenu( procedure TMainIDE.OnSrcNoteBookPopupMenu(const AddMenuItemProc: TAddMenuItemProc);
const AddMenuItemProc: TAddMenuItemProc);
begin begin
PkgBoss.OnSourceEditorPopupMenu(AddMenuItemProc); PkgBoss.OnSourceEditorPopupMenu(AddMenuItemProc);
end; end;
@ -12931,8 +12924,7 @@ begin
Result:=nil; Result:=nil;
end; end;
function TMainIDE.GetProjectFileWithDesigner(ADesigner: TIDesigner function TMainIDE.GetProjectFileWithDesigner(ADesigner: TIDesigner): TLazProjectFile;
): TLazProjectFile;
var var
TheDesigner: TDesigner; TheDesigner: TDesigner;
AComponent: TComponent; AComponent: TComponent;
@ -12944,8 +12936,7 @@ begin
Result:=GetProjectFileWithRootComponent(AComponent); Result:=GetProjectFileWithRootComponent(AComponent);
end; end;
function TMainIDE.OnPropHookMethodExists(const AMethodName: String; function TMainIDE.OnPropHookMethodExists(const AMethodName: String; TypeData: PTypeData;
TypeData: PTypeData;
var MethodIsCompatible,MethodIsPublished,IdentIsMethod: boolean): boolean; var MethodIsCompatible,MethodIsPublished,IdentIsMethod: boolean): boolean;
var var
ActiveSrcEdit: TSourceEditor; ActiveSrcEdit: TSourceEditor;
@ -12970,7 +12961,7 @@ end;
function TMainIDE.OnPropHookCreateMethod(const AMethodName: ShortString; function TMainIDE.OnPropHookCreateMethod(const AMethodName: ShortString;
ATypeInfo: PTypeInfo; ATypeInfo: PTypeInfo;
APersistent: TPersistent; const APropertyPath: string): TMethod; APersistent: TPersistent; const APropertyPath: string): TMethod;
{ APersistent is the intance that gets the new method, not the lookuproot. { APersistent is the instance that gets the new method, not the lookuproot.
For example assign 'Button1Click' to Form1.Button1.OnClick: For example assign 'Button1Click' to Form1.Button1.OnClick:
APersistent = APersistent APersistent = APersistent
AMethodName = 'Button1Click' AMethodName = 'Button1Click'
@ -13296,8 +13287,7 @@ begin
end; end;
if (ADesigner<>nil) and ((RegComp<>nil) or (ClassUnitInfo<>nil)) then begin if (ADesigner<>nil) and ((RegComp<>nil) or (ClassUnitInfo<>nil)) then begin
if not BeginCodeTool(ADesigner,ActiveSrcEdit,ActiveUnitInfo, if not BeginCodeTool(ADesigner,ActiveSrcEdit,ActiveUnitInfo,[ctfSwitchToFormSource])
[ctfSwitchToFormSource])
then exit; then exit;
// remember cursor position // remember cursor position
@ -13320,8 +13310,7 @@ begin
// add component definitions to form source // add component definitions to form source
Ancestor:=GetAncestorLookupRoot(ActiveUnitInfo); Ancestor:=GetAncestorLookupRoot(ActiveUnitInfo);
CodeToolBoss.CompleteComponent(ActiveUnitInfo.Source,ADesigner.LookupRoot, CodeToolBoss.CompleteComponent(ActiveUnitInfo.Source,ADesigner.LookupRoot,Ancestor);
Ancestor);
end; end;
if ObjectInspector1<>nil then if ObjectInspector1<>nil then