Thread: [PATCH] Beautify line-ends handling yet more.

[PATCH] Beautify line-ends handling yet more.

From
Nikolai Zhubr
Date:
Hello Dave,

Attached are two more patches, mostly cosmetic:

*  Make a better guess of default line-end type based on platform type.
*  Get rid of #ifdef -- let wxTextBuffer::Translate do all the work.

Sending as attachments, let me know if inserting inline is preferred.

Tested on windows only, but I think should not break other platforms.


Thank you,
Nikolai


Attachment

Re: [PATCH] Beautify line-ends handling yet more.

From
Dave Page
Date:
Hi

On Wed, Oct 7, 2015 at 7:47 PM, Nikolai Zhubr <n-a-zhubr@yandex.ru> wrote:
> Hello Dave,
>
> Attached are two more patches, mostly cosmetic:
>
> *  Make a better guess of default line-end type based on platform type.

I committed a modified version of this - Mac OS X uses \n as a
line-end, so that makes a better default than the old-style \r used on
Mac classic.

> *  Get rid of #ifdef -- let wxTextBuffer::Translate do all the work.

Committed.

> Sending as attachments, let me know if inserting inline is preferred.

Please use attachments created with "git diff > foo.diff". I had to
manually apply the patches above for some reason, but git diff should
usually work fine (and inlining them is just painful!) :-)

Thanks!


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [PATCH] Beautify line-ends handling yet more.

From
Nikolai Zhubr
Date:
Hello Dave,
09.10.2015 16:31, Dave Page wrote:
[...]
> I committed a modified version of this - Mac OS X uses \n as a
> line-end, so that makes a better default than the old-style \r used on
> Mac classic.

Ah, I didn't know that, thanks for explanation.

I suppose it is unlikely someone will use current (and future) releases
of pgamin3 on Mac classic, therefore I'd propose to also update the
corresponding preferences menu. Right now it shows 3 possibilities:

* Unix (LF)
* DOS (CRLF)
* Mac (CR)

Maybe it would make sense to only provide 2 with the following naming:

* Unix/Mac (LF)
* DOS/Windows (CRLF)

If it is OK then I'll craft a git diff for that (eventually).


Thank you,
Nikolai


Re: [PATCH] Beautify line-ends handling yet more.

From
Dave Page
Date:

> On 10 Oct 2015, at 13:33, Nikolai Zhubr <n-a-zhubr@yandex.ru> wrote:
>
> Hello Dave,
> 09.10.2015 16:31, Dave Page wrote:
> [...]
>> I committed a modified version of this - Mac OS X uses \n as a
>> line-end, so that makes a better default than the old-style \r used on
>> Mac classic.
>
> Ah, I didn't know that, thanks for explanation.
>
> I suppose it is unlikely someone will use current (and future) releases of pgamin3 on Mac classic, therefore I'd
proposeto also update the corresponding preferences menu. Right now it shows 3 possibilities: 
>
> * Unix (LF)
> * DOS (CRLF)
> * Mac (CR)
>
> Maybe it would make sense to only provide 2 with the following naming:
>
> * Unix/Mac (LF)
> * DOS/Windows (CRLF)
>
> If it is OK then I'll craft a git diff for that (eventually).

I'm not sure we should - it may be useful for someone working with legacy systems, and it's not like it's a massive
amountof code bloating the app or overly complicating the UI. 

Re: [PATCH] Beautify line-ends handling yet more.

From
Nikolai Zhubr
Date:
Hello Dave,
10.10.2015 16:51, Dave Page wrote:
[...]
>> * Unix/Mac (LF)
>> * DOS/Windows (CRLF)
>>
>> If it is OK then I'll craft a git diff for that (eventually).
>
> I'm not sure we should - it may be useful for someone working with legacy systems, and it's not like it's a massive
amountof code bloating the app or overly complicating the UI. 

Ok, understood.

And btw special thanks for bringing back windows xp compatability in
beta1. It works fine for me so far.


Thank you,
Nikolai


Re: [PATCH] Beautify line-ends handling yet more.

From
Szabolcs Hubai
Date:
As an alternative solution you could do it as Notepad++ does:
Unix/Mac, DOS/Windows, old Mac.

2015-10-10 15:51 GMT+02:00 Dave Page <dpage@pgadmin.org>:
>
>
>> On 10 Oct 2015, at 13:33, Nikolai Zhubr <n-a-zhubr@yandex.ru> wrote:
>>
>> Hello Dave,
>> 09.10.2015 16:31, Dave Page wrote:
>> [...]
>>> I committed a modified version of this - Mac OS X uses \n as a
>>> line-end, so that makes a better default than the old-style \r used on
>>> Mac classic.
>>
>> Ah, I didn't know that, thanks for explanation.
>>
>> I suppose it is unlikely someone will use current (and future) releases of pgamin3 on Mac classic, therefore I'd
proposeto also update the corresponding preferences menu. Right now it shows 3 possibilities: 
>>
>> * Unix (LF)
>> * DOS (CRLF)
>> * Mac (CR)
>>
>> Maybe it would make sense to only provide 2 with the following naming:
>>
>> * Unix/Mac (LF)
>> * DOS/Windows (CRLF)
>>
>> If it is OK then I'll craft a git diff for that (eventually).
>
> I'm not sure we should - it may be useful for someone working with legacy systems, and it's not like it's a massive
amountof code bloating the app or overly complicating the UI. 
>
> --
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers