fix, completion menu, auto scroll only worked after dot completion

+ ident match fine tweaks: only if more than 2 chars, or always if selection available
This commit is contained in:
Basile Burg 2015-12-15 01:19:34 +01:00
parent 102ff937d2
commit d3f7196af6
1 changed files with 10 additions and 3 deletions

View File

@ -772,7 +772,8 @@ begin
ecCompletionMenu: ecCompletionMenu:
begin begin
fCanAutoDot:=false; fCanAutoDot:=false;
fCompletion.Execute('', ClientToScreen(point(CaretXPix, CaretYPix + Font.Size))); fCompletion.Execute(GetWordAtRowCol(LogicalCaretXY),
ClientToScreen(point(CaretXPix, CaretYPix)));
end; end;
ecPreviousLocation: ecPreviousLocation:
fPositions.back; fPositions.back;
@ -844,7 +845,10 @@ end;
procedure TCESynMemo.highlightCurrentIdentifier; procedure TCESynMemo.highlightCurrentIdentifier;
begin begin
fIdentifier := GetWordAtRowCol(LogicalCaretXY); fIdentifier := GetWordAtRowCol(LogicalCaretXY);
SetHighlightSearch(fIdentifier,[ssoEntireScope, ssoMatchCase]); if (length(fIdentifier) > 2) and (not SelAvail) then
SetHighlightSearch(fIdentifier,[ssoMatchCase])
else if SelAvail then
SetHighlightSearch(SelText,[ssoMatchCase]);
end; end;
procedure TCESynMemo.changeNotify(Sender: TObject); procedure TCESynMemo.changeNotify(Sender: TObject);
@ -1030,7 +1034,8 @@ begin
VK_SUBTRACT: if Font.Size > 3 then Font.Size := Font.Size - 1; VK_SUBTRACT: if Font.Size > 3 then Font.Size := Font.Size - 1;
VK_DECIMAL: Font.Size := fDefaultFontSize; VK_DECIMAL: Font.Size := fDefaultFontSize;
end; end;
TCEEditorHintWindow.FontSize := Font.Size; if fCompletion.IsActive then
fCompletion.CurrentString:= GetWordAtRowCol(LogicalCaretXY);
fCanShowHint:=false; fCanShowHint:=false;
fDDocWin.Hide; fDDocWin.Hide;
end; end;
@ -1057,6 +1062,8 @@ begin
'(': getCallTips; '(': getCallTips;
')': fCallTipWin.Hide; ')': fCallTipWin.Hide;
end; end;
if fCompletion.IsActive then
fCompletion.CurrentString:=GetWordAtRowCol(LogicalCaretXY);
end; end;
procedure TCESynMemo.MouseLeave; procedure TCESynMemo.MouseLeave;