Create a Tmemo with the size of say 300 by 300 pixels. Enter two lines at design time into the memo; the first line with 10 characters, the second line with 100 characters.
Programmatically run the following code (for example by assigning to a Button's onClick event):
The memo will scroll to the left so that the caret (or the fifth character of the first line) goes to the leftmost edge of the memo.
There is no reason for the memo to scroll, because the whole first line fits in the memo's width.
This does not happen in Windows. It happens only in Linux.I tried also the following with no difference:
Memo1.Lines.BeginUpdate;
try
Memo1.SelStart := 4;
finally
Memo1.Lines.EndUpdate;
end;
How can I prevent the unnecessary scrolling, so that Lazarus Memo behaves the same as in Windows?
Note that, I
do want to put the caret after the 4th character position, but I do not want the Memo to scroll unnecessarily, unless the caret goes out of view.