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; i, j, Len, IndentLen, TokenStartX: integer;
s: string; s: string;
IdxMaybe, NumMaybe: integer; IdxMaybe, NumMaybe: integer;
p: TPoint; p, p2: TPoint;
NewCaretPos: boolean; NewCaretPos: boolean;
Temp: TStringList; Temp: TStringList;
begin begin
@ -369,7 +369,9 @@ begin
Temp.Free; Temp.Free;
end; end;
// replace the selected text and position the caret // 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 if NewCaretPos then
AEditor.CaretXY := p; AEditor.CaretXY := p;
AEditor.EnsureCursorPosVisible; AEditor.EnsureCursorPosVisible;