[Lazarus] SynEdit changes line ending

Martin lazarus at mfriebe.de
Fri Jun 7 23:31:15 CEST 2013


On 31/05/2013 15:01, Mattias Gaertner wrote:
> On Fri, 31 May 2013 13:18:45 +0300
> "Misha Padalka" <misha-cn-ua at ya.ru> wrote:
>
>> Fri, 31 May 2013 13:15:57 +0300 було написано Mattias Gaertner
>> <nc-gaertnma at netcologne.de>:
>> [...]
>>> Synedit only supports one line ending type for the whole text, not per
>>> line.
>> I know that, but I assign whole text, not its part. So I think it should
>> save it's line ending style.
> Looking at the source code the LoadFromFile supports that. I don't see
> it for SetText. Probable Martin knows more.
>

Yes, it is only supported by LoadFromFile/SaveToFile (and only because 
it was there since probably before we forked).

I would not be in favour of detecting the style when setting text. That 
will lead to a lot of confusion. There may be mixed style, or other 
operations later can have other style. It is also unescesarry work, for 
something rarely ever needed (unless stored for each line, but that is a 
huge feature).

It would *probably* not be hard to add it to "GetText" (property Text) 
(with a property, that the user can set, to the desired line-ending).

But imho that just gets the problem started. Once it works for GetText, 
users will (rightfully) expect it for other methods to: SynEdit.SelText 
/ SynEdit.TextBetweenPoints / CopyToClipboard ....
And that will be a lot more work (still possible).






More information about the Lazarus mailing list