mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-29 04:11:06 +02:00
fixed synedit ensure cursor pos visible with tab chars
git-svn-id: trunk@2500 -
This commit is contained in:
parent
62b5b4ef5a
commit
d139150e08
@ -5451,15 +5451,18 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomSynEdit.EnsureCursorPosVisible;
|
procedure TCustomSynEdit.EnsureCursorPosVisible;
|
||||||
|
var
|
||||||
|
PhysCaretXY: TPoint;
|
||||||
begin
|
begin
|
||||||
IncPaintLock;
|
IncPaintLock;
|
||||||
try
|
try
|
||||||
// Make sure X is visible
|
// Make sure X is visible
|
||||||
//writeln('[TCustomSynEdit.EnsureCursorPosVisible] A CaretX=',CaretX,' LeftChar=',LeftChar,' CharsInWindow=',CharsInWindow,' ClientWidth=',ClientWidth);
|
//writeln('[TCustomSynEdit.EnsureCursorPosVisible] A CaretX=',CaretX,' LeftChar=',LeftChar,' CharsInWindow=',CharsInWindow,' ClientWidth=',ClientWidth);
|
||||||
if CaretX < LeftChar then
|
PhysCaretXY:=LogicalToPhysicalPos(CaretXY);
|
||||||
LeftChar := CaretX
|
if PhysCaretXY.X < LeftChar then
|
||||||
else if CaretX > CharsInWindow + LeftChar then
|
LeftChar := PhysCaretXY.X
|
||||||
LeftChar := CaretX - CharsInWindow + 1
|
else if PhysCaretXY.X > CharsInWindow + LeftChar then
|
||||||
|
LeftChar := PhysCaretXY.X - CharsInWindow + 1
|
||||||
else
|
else
|
||||||
LeftChar := LeftChar; //mh 2000-10-19
|
LeftChar := LeftChar; //mh 2000-10-19
|
||||||
// Make sure Y is visible
|
// Make sure Y is visible
|
||||||
|
Loading…
Reference in New Issue
Block a user