|
@@ -4846,7 +4846,7 @@ end;
|
|
|
function TCompileForm.InitiateAutoCompleteOrCallTipAllowedAtPos(const AMemo: TCompScintEdit;
|
|
|
const WordStartLinePos, PositionBeforeWordStartPos: Integer): Boolean;
|
|
|
begin
|
|
|
- Result := (PositionBeforeWordStartPos >= WordStartLinePos) and
|
|
|
+ Result := (PositionBeforeWordStartPos < WordStartLinePos) or
|
|
|
not FMemosStyler.IsCommentOrPascalStringStyle(AMemo.GetStyleAtPosition(PositionBeforeWordStartPos));
|
|
|
end;
|
|
|
|
|
@@ -4932,6 +4932,10 @@ begin
|
|
|
begin
|
|
|
Section := FMemosStyler.GetSectionFromLineState(FActiveMemo.Lines.State[Line]);
|
|
|
if Section = scCode then begin
|
|
|
+ { Space can only initiate autocompletion after non whitespace }
|
|
|
+ if (Key = ' ') and OnlyWhiteSpaceBeforeWord(FActiveMemo, LinePos, WordStartPos) then
|
|
|
+ Exit;
|
|
|
+
|
|
|
var PositionBeforeWordStartPos := FActiveMemo.GetPositionBefore(WordStartPos);
|
|
|
if Key <> #0 then begin
|
|
|
FActiveMemo.StyleNeeded(PositionBeforeWordStartPos); { Make sure the typed character has been styled }
|