From 03d7a522189f555dad314fdf51e4bcac6552df8a Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Fri, 22 May 2015 09:23:13 +0200 Subject: [PATCH] added editable option 'autoDotDelay' delay before completion menu automatically appears, 0 disables the feature --- src/ce_editoroptions.pas | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ce_editoroptions.pas b/src/ce_editoroptions.pas index 957c7175..808f5415 100644 --- a/src/ce_editoroptions.pas +++ b/src/ce_editoroptions.pas @@ -38,6 +38,7 @@ type fFont: TFont; // fHintDelay: Integer; + fAutoDotDelay: Integer; fTabWidth: Integer; fBlockIdent: Integer; fLineSpacing: Integer; @@ -58,7 +59,9 @@ type procedure setTxtSyn(aValue: TPersistent); procedure setShortcuts(aValue: TCollection); procedure setHintDelay(aValue: Integer); + procedure setAutoDotDelay(aValue: Integer); published + property autoDotDelay: integer read fAutoDotDelay write SetautoDotDelay; property hintDelay: Integer read fHintDelay write setHintDelay; property bracketMatchColor: TSynSelectedColor read fBracketMatchColor write setBracketMatchColor; property mouseLinkColor: TSynSelectedColor read fMouseLinkColor write setMouseLinkColor; @@ -146,6 +149,7 @@ begin fTxtSyn.Assign(TxtSyn); // fHintDelay:=200; + fAutoDotDelay:=200; fSelCol := TSynSelectedColor.Create; fFoldedColor := TSynSelectedColor.Create; fMouseLinkColor := TSynSelectedColor.Create; @@ -214,6 +218,7 @@ begin begin srcopt := TCEEditorOptionsBase(src); // + fAutoDotDelay:=srcopt.fAutoDotDelay; fHintDelay:=srcopt.fHintDelay; fFont.Assign(srcopt.fFont); fSelCol.Assign(srcopt.fSelCol); @@ -245,6 +250,13 @@ begin fHintDelay:=aValue; end; +procedure TCEEditorOptionsBase.setAutoDotDelay(aValue: Integer); +begin + if aValue > 2000 then aValue := 2000 + else if aValue < 0 then aValue := 0; + fAutoDotDelay:=aValue; +end; + procedure TCEEditorOptionsBase.setShortcuts(aValue: TCollection); begin fShortCuts.Assign(aValue); @@ -443,6 +455,7 @@ var shc: TCEPersistentShortcut; kst: TSynEditKeyStroke; begin + anEditor.autoDotDelay:=fAutoDotDelay; anEditor.hintDelay:=fHintDelay; anEditor.defaultFontSize := font.Size; anEditor.Font.Assign(font);