mirror of https://gitlab.com/basile.b/dexed.git
add option to auto call completion features, close #134
This commit is contained in:
parent
7eeb5dbe0a
commit
1f20bd9b6c
|
@ -64,6 +64,7 @@ type
|
||||||
fAutoClosedPairs: TAutoClosePairs;
|
fAutoClosedPairs: TAutoClosePairs;
|
||||||
fSmartDdocNewline: boolean;
|
fSmartDdocNewline: boolean;
|
||||||
fInsertPlusDdoc: boolean;
|
fInsertPlusDdoc: boolean;
|
||||||
|
fAutoCallCompletion: boolean;
|
||||||
//
|
//
|
||||||
procedure setPhobosDocRoot(value: TCEPathname);
|
procedure setPhobosDocRoot(value: TCEPathname);
|
||||||
procedure setFont(value: TFont);
|
procedure setFont(value: TFont);
|
||||||
|
@ -82,6 +83,7 @@ type
|
||||||
procedure setLineNumEvery(value: integer);
|
procedure setLineNumEvery(value: integer);
|
||||||
published
|
published
|
||||||
property alwaysAdvancedFeatures: boolean read fAlwaysAdvancedFeatures write fAlwaysAdvancedFeatures;
|
property alwaysAdvancedFeatures: boolean read fAlwaysAdvancedFeatures write fAlwaysAdvancedFeatures;
|
||||||
|
property autoCallCompletion: boolean read fAutoCallCompletion write fAutoCallCompletion;
|
||||||
property autoCloseCurlyBrace: TBraceAutoCloseStyle read fAutoCloseCurlyBrace write fAutoCloseCurlyBrace default TBraceAutoCloseStyle.autoCloseNever;
|
property autoCloseCurlyBrace: TBraceAutoCloseStyle read fAutoCloseCurlyBrace write fAutoCloseCurlyBrace default TBraceAutoCloseStyle.autoCloseNever;
|
||||||
property autoClosedPairs: TAutoClosePairs read fAutoClosedPairs write fAutoClosedPairs default[];
|
property autoClosedPairs: TAutoClosePairs read fAutoClosedPairs write fAutoClosedPairs default[];
|
||||||
property autoDotDelay: integer read fAutoDotDelay write SetautoDotDelay;
|
property autoDotDelay: integer read fAutoDotDelay write SetautoDotDelay;
|
||||||
|
@ -307,6 +309,7 @@ begin
|
||||||
detectIndentMode:=srcopt.detectIndentMode;
|
detectIndentMode:=srcopt.detectIndentMode;
|
||||||
fPhobosDocRoot:=srcopt.fPhobosDocRoot;
|
fPhobosDocRoot:=srcopt.fPhobosDocRoot;
|
||||||
fInsertPlusDdoc:= srcopt.fInsertPlusDdoc;
|
fInsertPlusDdoc:= srcopt.fInsertPlusDdoc;
|
||||||
|
fAutoCallCompletion:= srcopt.fAutoCallCompletion;
|
||||||
|
|
||||||
fSmartDdocNewline:=srcopt.fSmartDdocNewline;
|
fSmartDdocNewline:=srcopt.fSmartDdocNewline;
|
||||||
if fSmartDdocNewline then
|
if fSmartDdocNewline then
|
||||||
|
@ -678,6 +681,7 @@ begin
|
||||||
anEditor.alwaysAdvancedFeatures:=fAlwaysAdvancedFeatures;
|
anEditor.alwaysAdvancedFeatures:=fAlwaysAdvancedFeatures;
|
||||||
anEditor.smartDdocNewline:= fSmartDdocNewline;
|
anEditor.smartDdocNewline:= fSmartDdocNewline;
|
||||||
anEditor.insertPlusDdoc:= fInsertPlusDdoc;
|
anEditor.insertPlusDdoc:= fInsertPlusDdoc;
|
||||||
|
anEditor.autoCallCompletion:= fAutoCallCompletion;
|
||||||
for i := 0 to anEditor.Keystrokes.Count-1 do
|
for i := 0 to anEditor.Keystrokes.Count-1 do
|
||||||
begin
|
begin
|
||||||
kst := anEditor.Keystrokes.Items[i];
|
kst := anEditor.Keystrokes.Items[i];
|
||||||
|
|
|
@ -13,7 +13,8 @@ uses
|
||||||
//SynEditMarkupFoldColoring,
|
//SynEditMarkupFoldColoring,
|
||||||
Clipbrd, fpjson, jsonparser, LazUTF8, LazUTF8Classes, Buttons, StdCtrls,
|
Clipbrd, fpjson, jsonparser, LazUTF8, LazUTF8Classes, Buttons, StdCtrls,
|
||||||
ce_common, ce_writableComponent, ce_d2syn, ce_txtsyn, ce_dialogs, ce_dastworx,
|
ce_common, ce_writableComponent, ce_d2syn, ce_txtsyn, ce_dialogs, ce_dastworx,
|
||||||
ce_sharedres, ce_dlang, ce_stringrange, ce_dbgitf, ce_observer, ce_diff;
|
ce_sharedres, ce_dlang, ce_stringrange, ce_dbgitf, ce_observer, ce_diff,
|
||||||
|
ce_dlangutils;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
@ -182,6 +183,7 @@ type
|
||||||
fLastCompletion: string;
|
fLastCompletion: string;
|
||||||
fDebugger: ICEDebugger;
|
fDebugger: ICEDebugger;
|
||||||
fInsertPlusDdoc: boolean;
|
fInsertPlusDdoc: boolean;
|
||||||
|
fAutoCallCompletion: boolean;
|
||||||
procedure decCallTipsLvl;
|
procedure decCallTipsLvl;
|
||||||
procedure setMatchOpts(value: TIdentifierMatchOptions);
|
procedure setMatchOpts(value: TIdentifierMatchOptions);
|
||||||
function getMouseBytePosition: Integer;
|
function getMouseBytePosition: Integer;
|
||||||
|
@ -307,6 +309,7 @@ type
|
||||||
property autoClosedPairs: TAutoClosePairs read fAutoClosedPairs write fAutoClosedPairs;
|
property autoClosedPairs: TAutoClosePairs read fAutoClosedPairs write fAutoClosedPairs;
|
||||||
property smartDdocNewline: boolean read fSmartDdocNewline write fSmartDdocNewline;
|
property smartDdocNewline: boolean read fSmartDdocNewline write fSmartDdocNewline;
|
||||||
property insertPlusDdoc: boolean read fInsertPlusDdoc write fInsertPlusDdoc;
|
property insertPlusDdoc: boolean read fInsertPlusDdoc write fInsertPlusDdoc;
|
||||||
|
property autoCallCompletion: boolean read fAutoCallCompletion write fAutoCallCompletion;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TSortDialog = class(TForm)
|
TSortDialog = class(TForm)
|
||||||
|
@ -2084,8 +2087,8 @@ procedure TCESynMemo.completionCodeCompletion(var value: string;
|
||||||
SourceValue: string; var SourceStart, SourceEnd: TPoint; KeyChar: TUTF8Char;
|
SourceValue: string; var SourceStart, SourceEnd: TPoint; KeyChar: TUTF8Char;
|
||||||
Shift: TShiftState);
|
Shift: TShiftState);
|
||||||
begin
|
begin
|
||||||
if KeyChar = '.' then
|
if (isOperator1(KeyChar[1])) or (KeyChar[1] = ' ') then
|
||||||
value := '.'
|
value := SourceValue + KeyChar
|
||||||
else
|
else
|
||||||
fLastCompletion := value;
|
fLastCompletion := value;
|
||||||
end;
|
end;
|
||||||
|
@ -2610,7 +2613,7 @@ begin
|
||||||
inherited;
|
inherited;
|
||||||
highlightCurrentIdentifier;
|
highlightCurrentIdentifier;
|
||||||
if fCompletion.IsActive then
|
if fCompletion.IsActive then
|
||||||
fCompletion.CurrentString:= GetWordAtRowCol(LogicalCaretXY);
|
fCompletion.CurrentString:= GetWordAtRowCol(LogicalCaretXY);
|
||||||
case Key of
|
case Key of
|
||||||
VK_BROWSER_BACK: fPositions.back;
|
VK_BROWSER_BACK: fPositions.back;
|
||||||
VK_BROWSER_FORWARD: fPositions.next;
|
VK_BROWSER_FORWARD: fPositions.next;
|
||||||
|
@ -2637,7 +2640,12 @@ begin
|
||||||
VK_OEM_PERIOD, VK_DECIMAL: fCanAutoDot := true;
|
VK_OEM_PERIOD, VK_DECIMAL: fCanAutoDot := true;
|
||||||
end;
|
end;
|
||||||
inherited;
|
inherited;
|
||||||
|
if fAutoCallCompletion and fIsDSource and (not fCompletion.IsActive) and
|
||||||
|
(Key < $80) and (char(Key) in ['a'..'z', 'A'..'Z']) then
|
||||||
|
begin
|
||||||
|
fCompletion.Execute(GetWordAtRowCol(LogicalCaretXY),
|
||||||
|
ClientToScreen(point(CaretXPix, CaretYPix + LineHeight)));
|
||||||
|
end;
|
||||||
if StaticEditorMacro.automatic then
|
if StaticEditorMacro.automatic then
|
||||||
StaticEditorMacro.Execute;
|
StaticEditorMacro.Execute;
|
||||||
end;
|
end;
|
||||||
|
|
Loading…
Reference in New Issue