public inbox for [email protected]  
help / color / mirror / Atom feed
From: Nikolai Zhubr <[email protected]>
To: [email protected]
Subject: Re: Copy to clipboard from ctlSQLBox on windows has line ends broken.
Date: Wed, 07 Oct 2015 01:23:29 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgadmin-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
>
>



-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers



view thread (5+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: Copy to clipboard from ctlSQLBox on windows has line ends broken.
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox