mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-26 22:29:25 +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;
|
||||
|
||||
procedure TCustomSynEdit.EnsureCursorPosVisible;
|
||||
var
|
||||
PhysCaretXY: TPoint;
|
||||
begin
|
||||
IncPaintLock;
|
||||
try
|
||||
// Make sure X is visible
|
||||
//writeln('[TCustomSynEdit.EnsureCursorPosVisible] A CaretX=',CaretX,' LeftChar=',LeftChar,' CharsInWindow=',CharsInWindow,' ClientWidth=',ClientWidth);
|
||||
if CaretX < LeftChar then
|
||||
LeftChar := CaretX
|
||||
else if CaretX > CharsInWindow + LeftChar then
|
||||
LeftChar := CaretX - CharsInWindow + 1
|
||||
PhysCaretXY:=LogicalToPhysicalPos(CaretXY);
|
||||
if PhysCaretXY.X < LeftChar then
|
||||
LeftChar := PhysCaretXY.X
|
||||
else if PhysCaretXY.X > CharsInWindow + LeftChar then
|
||||
LeftChar := PhysCaretXY.X - CharsInWindow + 1
|
||||
else
|
||||
LeftChar := LeftChar; //mh 2000-10-19
|
||||
// Make sure Y is visible
|
||||
|
Loading…
Reference in New Issue
Block a user