Re: Copy to clipboard from ctlSQLBox on windows has line ends broken. - Mailing list pgadmin-hackers

From Nikolai Zhubr
Subject Re: Copy to clipboard from ctlSQLBox on windows has line ends broken.
Date
Msg-id 561449E1.6050100@yandex.ru
Whole thread Raw
In response to Copy to clipboard from ctlSQLBox on windows has line ends broken.  (Nikolai Zhubr <n-a-zhubr@yandex.ru>)
Responses [PATCH] Perform conversion to platform line-ends when copying to clipboard (Was: Copy to clipboard from ctlSQLBox on windows has line ends broken)  (Nikolai Zhubr <n-a-zhubr@yandex.ru>)
Re: Copy to clipboard from ctlSQLBox on windows has line ends broken.  (Dave Page <dpage@pgadmin.org>)
List pgadmin-hackers
Hi all,

As I've now found, a lot of pgXXX::GetSql() functions autogenerate sql
code using hardcoded LF line ends ('\n\n'), and this has been so for
ages, therefore probably it is OK.

But, in order for 'copy to clipboard' to work well (also on ms windows),
these LF line ends have to be somehow "compensated". Generally, it could
possibly be arranged in two places:

-- convert to the system line ending before passing it _to_ ctlSQLBox;
-- or convert just before copying to clipboard _from_ ctlSQLBox.

I'm not quite sure how it was initially supposed to work, but it did
work correctly on windows previously. Right now though I can not see any
such automatic conversions anywhere. Sure I could add some, but I'd like
to understand the whole picture first...


Thank you,
Nikolai


06.10.2015 16:45, I wrote:
> Hi all,
>
> Just discovered this. Only applicable for ms windows probably.
> Copying several lines of text to clipboard from the SQL info panel - the
> one normally located in the bottom-right corner of the main pgadmin
> window (not editable) - results in broken line-ends when pasting. It
> used to work perfectly fine in some more older (well, ancient) versions...
>
> Specifically, all text pasted appears as one huge single line, because
> line ends seem to be all unix style (LF). (Saving such pasted text to a
> file and looking at it in hex proves that LFs are there indeed instead
> of CRLFs)
>
> Now, for the SQL editor the problem does not really exist because there
> is a respective preference setting, so going to menu and changing it as
> appropriate helps (when copying from the editor). However, there is
> apparently no preference setting for the (read-only) SQL info panel.
>
> The problem was introduced before last release. It was present at least
> in 1.18.1, maybe even earlier.
>
> I'd appreciate if someone using ms windows confirmed the problem.
>
> Meanwhile I'll try to see if I can fix it. I think copying to clipboard
> should always use platform-default line-ends anyway...
>
>
> Thank you,
> Nikolai
>
>



pgadmin-hackers by date:

Previous
From: Nikolai Zhubr
Date:
Subject: Copy to clipboard from ctlSQLBox on windows has line ends broken.
Next
From: Nikolai Zhubr
Date:
Subject: [PATCH] Perform conversion to platform line-ends when copying to clipboard (Was: Copy to clipboard from ctlSQLBox on windows has line ends broken)