SynCompletion: Ensure caret pos

git-svn-id: trunk@38655 -
This commit is contained in:
martin 2012-09-14 12:32:27 +00:00
parent 1a0c213794
commit ba3925a8de

View File

@ -243,7 +243,7 @@ var
i, j, Len, IndentLen, TokenStartX: integer;
s: string;
IdxMaybe, NumMaybe: integer;
p: TPoint;
p, p2: TPoint;
NewCaretPos: boolean;
Temp: TStringList;
begin
@ -369,7 +369,9 @@ begin
Temp.Free;
end;
// replace the selected text and position the caret
AEditor.SelText := s;
p2 := AEditor.BlockBegin;
AEditor.SelText := '';
AEditor.SetTextBetweenPoints(p2, p2, s, [], scamEnd);
if NewCaretPos then
AEditor.CaretXY := p;
AEditor.EnsureCursorPosVisible;