Issue #2221: fix wrong detection of table alias and following dot, with text after the current cursor position

This commit is contained in:
Ansgar Becker
2025-07-31 10:59:05 +02:00
parent cbde322fde
commit ef54221504

View File

@ -6872,10 +6872,9 @@ begin
// Find token1.token2.token3, while cursor is somewhere in token3
Ident := '[^\s,\(\)=\.]';
rx.Expression := '(('+Ident+'+)\.)?('+Ident+'+)\.('+Ident+'*)$';
if FProposalTriggeredByDot then
LeftPart := Copy(Editor.LineText+'.', 1, Editor.CaretX)
else
LeftPart := Copy(Editor.LineText, 1, Editor.CaretX-1);
LeftPart := Copy(Editor.LineText, 1, Editor.CaretX-1);
if FProposalTriggeredByDot then // LineText does not yet contain pressed dot key, see SynMemoQueryProcessCommand
LeftPart := LeftPart + '.';
FProposalTriggeredByDot := False;
if rx.Exec(LeftPart) then begin
Token1 := Conn.DeQuoteIdent(rx.Match[2]);