Fix detection of previous token in query memo's. SynCompletionProposal.OnExecute passes x + y coordinates of current caret position - these are pixel values, while we expected them to be character + line numbers.

This commit is contained in:
Ansgar Becker
2009-12-06 17:12:56 +00:00
parent 0218e3b754
commit d3ff85b730

View File

@ -4125,8 +4125,8 @@ begin
rx := TRegExpr.Create;
// Find longer token, ignore EndOfTokenChars, just the last chars up to a whitespace, comma or paranthesis
rx.Expression := '([^\s,\(\)]+).$';
PrevLongToken := Copy(Editor.LineText, 0, x);
rx.Expression := '([^\s,\(\)]+)$';
PrevLongToken := Copy(Editor.LineText, 1, Editor.CaretX-2);
if rx.Exec(PrevLongToken) then
PrevLongToken := rx.Match[1]
else