fix, possible rng error if completion proposal count reached max value, + disable completion full length hint (until the font is properly scaled)

This commit is contained in:
Basile Burg 2015-10-15 05:15:40 +02:00
parent a604e9cacf
commit 1bf0b42314
1 changed files with 5 additions and 1 deletions

View File

@ -416,6 +416,7 @@ begin
fCompletion.OnCodeCompletion:=@completionCodeCompletion; fCompletion.OnCodeCompletion:=@completionCodeCompletion;
fCompletion.OnPaintItem:= @completionItemPaint; fCompletion.OnPaintItem:= @completionItemPaint;
fCompletion.CaseSensitive:=false; fCompletion.CaseSensitive:=false;
fCompletion.LongLineHintType:=sclpNone;
// //
MouseLinkColor.Style:= [fsUnderline]; MouseLinkColor.Style:= [fsUnderline];
with MouseActions.Add do begin with MouseActions.Add do begin
@ -693,7 +694,10 @@ var
lft, rgt: string; lft, rgt: string;
len: Integer; len: Integer;
begin begin
// warning: '20' depends on ce_dcd, case knd of, string literals length // empty items can be produced if completion list is too long
if aKey = '' then exit;
// otherwise always at least 20 chars but...
// ... '20' depends on ce_dcd, case knd of, string literals length
result := true; result := true;
lft := AKey[1 .. length(AKey)-20]; lft := AKey[1 .. length(AKey)-20];
rgt := AKey[length(AKey)-19 .. length(AKey)]; rgt := AKey[length(AKey)-19 .. length(AKey)];