Chris Colman wrote:
I'm having trouble working out a good line ending strategy - I've never
been a good finisher :)

I have a Windows app and I've tried a number of different options but
none of them seem to work in all cases. Often one strategy will work fun
but then when code is pasted into the editor it looks fine but when I
look at the same file under a different editor it shows double spacing.

Is there a "standard" line ending procedure to use for Windows apps or
is there some special handling that I have to code for paste operations?

At the risk of stating the obvious, yes, Windows has a "standard" line ending sequence: CR/LF (aka "\r\n" or "\x0d\x0a" etc), whereas *nix-like systems use just the LF... and historically, I *think* Macs used just the CR.

But times (and Macs?) change, and a lot of text-handling tools (like Scintilla) transparently accept any of the known forms.

Now, for your "paste" operation, I raised a closely related issue a few weeks ago, and Neil invited a paste operation (probably a new API call) that would insert a [possibly multi-line] string in a buffer with any contained line-endings normalized to the current mode for that buffer... ;)

One of the reasons I didn't jump on this was that I didn't have an elegant model for doing it that didn't involve either lots of small mallocs or a few huge ones - both objectionable (from my perspective).

Robert Roessler
[EMAIL PROTECTED]
http://www.rftp.com
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to