synedit: eoAlwaysVisibleCaret: fixed scrolling when inserting text on identifier completion, bug #10914

git-svn-id: trunk@14338 -
This commit is contained in:
mattias 2008-03-01 12:00:18 +00:00
parent 65a770df87
commit 8f3ae0f07f

View File

@ -5581,6 +5581,9 @@ begin
fLastCaretX := fCaretX; //mh 2000-10-19
if CaretY < 1 then
CaretY := 1;
{$IFDEF SYN_LAZARUS}
EnsureCursorPosVisible;
{$ENDIF}
finally
Lines.EndUpdate;
DecPaintLock;
@ -5681,6 +5684,7 @@ begin
end;
if CompareCarets(CaretXY,NewCaretXY)<>0 then
begin
//DebugLn(['TCustomSynEdit.MoveCaretToVisibleArea Old=',dbgs(CaretXY),' New=',dbgs(NewCaretXY)]);
CaretXY:=NewCaretXY;
end;
end;
@ -7578,6 +7582,7 @@ begin
// try to make the current selection visible as well
MinX:=PhysCaretXY.X;
MaxX:=PhysCaretXY.X;
if SelAvail then begin
PhysBlockBeginXY:=LogicalToPhysicalPos(BlockBegin);
PhysBlockEndXY:=LogicalToPhysicalPos(BlockEnd);
if (PhysBlockBeginXY.X<>PhysBlockEndXY.X)
@ -7593,6 +7598,7 @@ begin
if MaxX<PhysBlockEndXY.X then
MaxX:=Min(PhysBlockEndXY.X,MinX+CharsInWindow-1);
end;
end;
{DebugLn('TCustomSynEdit.EnsureCursorPosVisible A CaretX=',dbgs(PhysCaretXY.X),
' BlockX=',dbgs(PhysBlockBeginXY.X)+'-'+dbgs(PhysBlockEndXY.X),
' CharsInWindow='+dbgs(CharsInWindow),
@ -7606,7 +7612,7 @@ begin
LeftChar := MaxX - (CharsInWindow - 1)
else
LeftChar := LeftChar; //mh 2000-10-19
//DebugLn('TCustomSynEdit.EnsureCursorPosVisible B LeftChar=',LeftChar);
//DebugLn(['TCustomSynEdit.EnsureCursorPosVisible B LeftChar=',LeftChar,' MinX=',MinX,' MaxX=',MaxX,' CharsInWindow=',CharsInWindow]);
{$ELSE}
if PhysCaretXY.X < LeftChar then
LeftChar := PhysCaretXY.X