From 83b568904c6828953b7e80ed31ff32a9e7b99abe Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Fri, 7 Nov 2014 07:41:29 +0100 Subject: [PATCH] dcd integration: fixed identifier completion (without dot) --- src/ce_dcd.pas | 10 ++++++---- src/ce_editor.pas | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ce_dcd.pas b/src/ce_dcd.pas index 958f7445..86664237 100644 --- a/src/ce_dcd.pas +++ b/src/ce_dcd.pas @@ -88,10 +88,10 @@ end; procedure getCompletion(const aFilename: string; aPosition: Integer; const list: TStrings); var - i: NativeInt; + i, j: NativeInt; kind: Char; item: string; - asComp: boolean; + asComp, asTips: boolean; begin if not dcdOn then exit; lazyServerStart; @@ -106,10 +106,12 @@ begin if lines.Count = 0 then exit; asComp := lines.Strings[0] = 'identifiers'; - if not asComp then + asTips := lines.Strings[0] = 'calltips'; + if asTips then exit; + if asComp then j := 1 else j := 0; list.Clear; - for i := 1 to lines.Count-1 do + for i := j to lines.Count-1 do begin item := lines.Strings[i]; kind := item[length(item)]; diff --git a/src/ce_editor.pas b/src/ce_editor.pas index 5c3488b5..14ab6683 100644 --- a/src/ce_editor.pas +++ b/src/ce_editor.pas @@ -341,6 +341,7 @@ begin fDoc.Lines.SaveToStream(str); str.SaveToFile(fname); srcpos := fDoc.SelStart; + if srcpos > 0 then srcpos -= -1; completion.ItemList.Clear; ce_dcd.getCompletion(fname, srcpos, completion.ItemList); finally