TSynEdit range for horizontal scrollbar does not match text and window width
- Lazarus/FPC Version: main
- Operating System: Windows 7/8.1
- CPU / Bitness: x64
At the moment, the horizontal scrollbar has almost no meaning - it doesn't show the current width of the text, doesn't allow it to be scrolled - the slightest offset causes scrolling by the width of the page.
What happens
TSynEdit always shows large range for horizontal scrollbar even if text fits in viewport. It seems to be 1024 characters.
What did you expect
That the size of the scrollbar slider will match the width of the text and window.
Steps to reproduce
Just open the IDE and look at the horizontal scroll bar of the source code editor.
Or you can create a new project and place the TSynEdit component on the form.
Solution
https://forum.lazarus.freepascal.org/index.php?topic=28935.0
It seems that the point is in the value of the TSynEdit.MaxLeftChar
property by default - it is equal to 1024
. It turns out that logically it should be equal to 1
, then everything works as it should.
The name is confusing at first glance, but this property does not limit the width of the text (personally I would call it MinLeftChar
).
This property can be changed in the IDE code editor sources, but maybe change the default value for all TSynEdit?