mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 12:39:23 +02:00
SynEdit: Tests for keep caret x
git-svn-id: trunk@64826 -
This commit is contained in:
parent
9c4e45f598
commit
0de591ed36
@ -48,6 +48,7 @@ type
|
|||||||
procedure TestEditTabs;
|
procedure TestEditTabs;
|
||||||
procedure TestEditEcChar;
|
procedure TestEditEcChar;
|
||||||
procedure TestPhysicalLogical; // TODO adjust to char tests
|
procedure TestPhysicalLogical; // TODO adjust to char tests
|
||||||
|
procedure TestPhysicalLogicalCaretMove;
|
||||||
procedure TestLogicalAdjust;
|
procedure TestLogicalAdjust;
|
||||||
procedure TestCaretObject;
|
procedure TestCaretObject;
|
||||||
procedure TestCaretAutoMove;
|
procedure TestCaretAutoMove;
|
||||||
@ -794,6 +795,38 @@ begin
|
|||||||
TestPhysLog('bidi line (mixed arab/latin)',2, 15, 4, 0, 24, 0, 24, 0, 4, 0);
|
TestPhysLog('bidi line (mixed arab/latin)',2, 15, 4, 0, 24, 0, 24, 0, 4, 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TTestBasicSynEdit.TestPhysicalLogicalCaretMove;
|
||||||
|
begin
|
||||||
|
SetLines([
|
||||||
|
'//',
|
||||||
|
'// X あsf//',
|
||||||
|
'//😁X あsf//',
|
||||||
|
'//',
|
||||||
|
''
|
||||||
|
]);
|
||||||
|
|
||||||
|
SynEdit.Options := SynEdit.Options + [eoKeepCaretX] - [eoScrollPastEol];
|
||||||
|
|
||||||
|
SetCaretPhys(8, 2);
|
||||||
|
TestIsCaretPhys('(1st)', 8, 2);
|
||||||
|
TestIsCaret('(1st)', 9, 2);
|
||||||
|
|
||||||
|
SynEdit.CommandProcessor(ecDown, '', nil);
|
||||||
|
TestIsCaretPhys('(1st)', 7, 3);
|
||||||
|
TestIsCaret('(1st)', 9, 3);
|
||||||
|
SynEdit.CommandProcessor(ecDown, '', nil);
|
||||||
|
TestIsCaretPhys('(1st)', 3, 4);
|
||||||
|
|
||||||
|
SynEdit.CommandProcessor(ecUp, '', nil);
|
||||||
|
TestIsCaretPhys('(1st)', 7, 3);
|
||||||
|
TestIsCaret('(1st)', 9, 3);
|
||||||
|
SynEdit.CommandProcessor(ecUp, '', nil);
|
||||||
|
TestIsCaretPhys('(1st)', 8, 2);
|
||||||
|
TestIsCaret('(1st)', 9, 2);
|
||||||
|
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TTestBasicSynEdit.TestLogicalAdjust;
|
procedure TTestBasicSynEdit.TestLogicalAdjust;
|
||||||
var
|
var
|
||||||
tb: TSynEditStrings;
|
tb: TSynEditStrings;
|
||||||
@ -1145,7 +1178,7 @@ var
|
|||||||
TestCaret.LineCharPos := point(X, Y);
|
TestCaret.LineCharPos := point(X, Y);
|
||||||
if ChangeToLine > 0 then TestCaret.LinePos := ChangeToLine;
|
if ChangeToLine > 0 then TestCaret.LinePos := ChangeToLine;
|
||||||
if UseLock then TestCaret.Unlock;
|
if UseLock then TestCaret.Unlock;
|
||||||
end;
|
end;♠
|
||||||
procedure DoOneSetByte(Y, X, {%H-}O: Integer; ChangeToLine: Integer = -1);
|
procedure DoOneSetByte(Y, X, {%H-}O: Integer; ChangeToLine: Integer = -1);
|
||||||
begin
|
begin
|
||||||
if UseLock then TestCaret.Lock;
|
if UseLock then TestCaret.Lock;
|
||||||
@ -1498,6 +1531,22 @@ var
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
FPersistSel := False;
|
FPersistSel := False;
|
||||||
|
//(*
|
||||||
|
TestOrder := 6;
|
||||||
|
UseLock := True;
|
||||||
|
UseAdjustToNextChar := False;
|
||||||
|
UseIncAdjustToNextChar := False;
|
||||||
|
UseAllowPastEOL := False;
|
||||||
|
UseIncAllowPastEOL := False;
|
||||||
|
UseKeepCaretX := True;
|
||||||
|
UseChangeOnTouch := False;
|
||||||
|
UseIncAutoMoveOnEdit := False;
|
||||||
|
UseSkipTabs := False;
|
||||||
|
UseMaxLeft := False;
|
||||||
|
DoTests;
|
||||||
|
exit;
|
||||||
|
//*)
|
||||||
|
|
||||||
for TestOrder := 0 to 11 do // CheckAtPos (8) only runs first 4
|
for TestOrder := 0 to 11 do // CheckAtPos (8) only runs first 4
|
||||||
for UseLock := low(Boolean) to high(Boolean) do
|
for UseLock := low(Boolean) to high(Boolean) do
|
||||||
for UseAdjustToNextChar := low(Boolean) to high(Boolean) do
|
for UseAdjustToNextChar := low(Boolean) to high(Boolean) do
|
||||||
|
Loading…
Reference in New Issue
Block a user