From ef54221504ffb95d629221a1ba4b52db323d5280 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Thu, 31 Jul 2025 10:59:05 +0200 Subject: [PATCH] Issue #2221: fix wrong detection of table alias and following dot, with text after the current cursor position --- source/main.pas | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/main.pas b/source/main.pas index 96d2e286..fc299fc8 100644 --- a/source/main.pas +++ b/source/main.pas @@ -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]);