From d3f7196af6dd1f97342d2b8b60bb4632433a5f91 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Tue, 15 Dec 2015 01:19:34 +0100 Subject: [PATCH] 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 --- src/ce_synmemo.pas | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/ce_synmemo.pas b/src/ce_synmemo.pas index 7e735bac..0ef3de80 100644 --- a/src/ce_synmemo.pas +++ b/src/ce_synmemo.pas @@ -772,7 +772,8 @@ begin ecCompletionMenu: begin fCanAutoDot:=false; - fCompletion.Execute('', ClientToScreen(point(CaretXPix, CaretYPix + Font.Size))); + fCompletion.Execute(GetWordAtRowCol(LogicalCaretXY), + ClientToScreen(point(CaretXPix, CaretYPix))); end; ecPreviousLocation: fPositions.back; @@ -844,7 +845,10 @@ end; procedure TCESynMemo.highlightCurrentIdentifier; begin 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; procedure TCESynMemo.changeNotify(Sender: TObject); @@ -1030,7 +1034,8 @@ begin VK_SUBTRACT: if Font.Size > 3 then Font.Size := Font.Size - 1; VK_DECIMAL: Font.Size := fDefaultFontSize; end; - TCEEditorHintWindow.FontSize := Font.Size; + if fCompletion.IsActive then + fCompletion.CurrentString:= GetWordAtRowCol(LogicalCaretXY); fCanShowHint:=false; fDDocWin.Hide; end; @@ -1057,6 +1062,8 @@ begin '(': getCallTips; ')': fCallTipWin.Hide; end; + if fCompletion.IsActive then + fCompletion.CurrentString:=GetWordAtRowCol(LogicalCaretXY); end; procedure TCESynMemo.MouseLeave;