[Lazarus] Copy to clipboard from synedit

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] Copy to clipboard from synedit

Free Pascal - Lazarus mailing list

Hi,

If you copy text to the clipboard in synedit, an extra #0 character is
copied at the end. It does not happen for other controls I tested.

I tested on Linux, 64-bit GTK2, but I suppose it will be the same for other
platforms/widgetsets.

This can be seen easily: copy some source text in the IDE. Paste it in
libreoffice writer. You'll get a # character at the end.

Some programs handle it well (xclip), some do not.
I've also had problems copying text e.g. to a browser.

I tested on Linux, 64-bit GTK2, but I suppose it will be the same for other
platforms/widgetsets.

Michael.
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Copy to clipboard from synedit

Free Pascal - Lazarus mailing list
On Sun, 15 Jul 2018 10:36:06 +0200 (CEST)
Michael Van Canneyt via Lazarus <[hidden email]> wrote:

> Hi,
>
> If you copy text to the clipboard in synedit, an extra #0 character is
> copied at the end. It does not happen for other controls I tested.
>
> I tested on Linux, 64-bit GTK2, but I suppose it will be the same for other
> platforms/widgetsets.
>
> This can be seen easily: copy some source text in the IDE. Paste it in
> libreoffice writer. You'll get a # character at the end.
>
> Some programs handle it well (xclip), some do not.
> I've also had problems copying text e.g. to a browser.
>
> I tested on Linux, 64-bit GTK2, but I suppose it will be the same for other
> platforms/widgetsets.

A regression probably caused by this:
https://bugs.freepascal.org/view.php?id=21453

Mattias
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] Copy to clipboard from synedit

Free Pascal - Lazarus mailing list


On Sun, 15 Jul 2018, Mattias Gaertner via Lazarus wrote:

> On Sun, 15 Jul 2018 10:36:06 +0200 (CEST)
> Michael Van Canneyt via Lazarus <[hidden email]> wrote:
>
>> Hi,
>>
>> If you copy text to the clipboard in synedit, an extra #0 character is
>> copied at the end. It does not happen for other controls I tested.
>>
>> I tested on Linux, 64-bit GTK2, but I suppose it will be the same for other
>> platforms/widgetsets.
>>
>> This can be seen easily: copy some source text in the IDE. Paste it in
>> libreoffice writer. You'll get a # character at the end.
>>
>> Some programs handle it well (xclip), some do not.
>> I've also had problems copying text e.g. to a browser.
>>
>> I tested on Linux, 64-bit GTK2, but I suppose it will be the same for other
>> platforms/widgetsets.
>
> A regression probably caused by this:
> https://bugs.freepascal.org/view.php?id=21453

It seems a fix is available but needs to be enabled using a define ?

Michael.
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

[Lazarus] TESTERS NEEDED / ALL PLATFORMS / COPY AND PASTE / Re: Copy to clipboard from synedit

Free Pascal - Lazarus mailing list
On 15/07/2018 12:07, Michael Van Canneyt via Lazarus wrote:
>
>
> It seems a fix is available but needs to be enabled using a define ?

Please try with rev 58530

To be tested:

- Copy one word from synedit  to  synedit
- Copy one word from synedit  to  TEdit or TMemo
- Copy one word from synedit  to  libre office (or other external app)


All of the above with multiline / full line
All of the above in reverse
All of the above with "column mode selection"

Fold a begin/end (or any other) block in synedit.
Copy a selection containing the entire folded block.
Paste it in SynEdit => the pasted text should have the block folded
(assuming you did not disable this in options)

=====================
The old patch had a problem:

It removed the #0 from any clipboard data. Including Text, images, custom.
But the LCL only added the extra to text (and only if added via "AsText")

So any data added any other way, if it had a #0 (that was part of the
data) would be mangled.
SynEdit adds custom data (to preserve folds).


--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] TESTERS NEEDED / ALL PLATFORMS / COPY AND PASTE / Re: Copy to clipboard from synedit

Free Pascal - Lazarus mailing list
Those tests should be done WITHOUT
GTK_REMOVE_CLIPBOARD_NULL
defined.

On 15/07/2018 12:27, Martin Frb via Lazarus wrote:

> On 15/07/2018 12:07, Michael Van Canneyt via Lazarus wrote:
>>
>>
>> It seems a fix is available but needs to be enabled using a define ?
>
> Please try with rev 58530
>
> To be tested:
>
> - Copy one word from synedit  to  synedit
> - Copy one word from synedit  to  TEdit or TMemo
> - Copy one word from synedit  to  libre office (or other external app)
>
>
> All of the above with multiline / full line
> All of the above in reverse
> All of the above with "column mode selection"
>
> Fold a begin/end (or any other) block in synedit.
> Copy a selection containing the entire folded block.
> Paste it in SynEdit => the pasted text should have the block folded
> (assuming you did not disable this in options)
>
> =====================
> The old patch had a problem:
>
> It removed the #0 from any clipboard data. Including Text, images,
> custom.
> But the LCL only added the extra to text (and only if added via "AsText")
>
> So any data added any other way, if it had a #0 (that was part of the
> data) would be mangled.
> SynEdit adds custom data (to preserve folds).
>
>

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] TESTERS NEEDED / ALL PLATFORMS / COPY AND PASTE / Re: Copy to clipboard from synedit

Free Pascal - Lazarus mailing list

Updated.

Tested copying word, line, multiline, and reversely selected to edit, memo, libreoffice.

All seems well. GTK2, linux, 64-bit.

Michael.



On Sun, 15 Jul 2018, Martin Frb via Lazarus wrote:

> Those tests should be done WITHOUT
> GTK_REMOVE_CLIPBOARD_NULL
> defined.
>
> On 15/07/2018 12:27, Martin Frb via Lazarus wrote:
>> On 15/07/2018 12:07, Michael Van Canneyt via Lazarus wrote:
>>>
>>>
>>> It seems a fix is available but needs to be enabled using a define ?
>>
>> Please try with rev 58530
>>
>> To be tested:
>>
>> - Copy one word from synedit  to  synedit
>> - Copy one word from synedit  to  TEdit or TMemo
>> - Copy one word from synedit  to  libre office (or other external app)
>>
>>
>> All of the above with multiline / full line
>> All of the above in reverse
>> All of the above with "column mode selection"
>>
>> Fold a begin/end (or any other) block in synedit.
>> Copy a selection containing the entire folded block.
>> Paste it in SynEdit => the pasted text should have the block folded
>> (assuming you did not disable this in options)
>>
>> =====================
>> The old patch had a problem:
>>
>> It removed the #0 from any clipboard data. Including Text, images,
>> custom.
>> But the LCL only added the extra to text (and only if added via "AsText")
>>
>> So any data added any other way, if it had a #0 (that was part of the
>> data) would be mangled.
>> SynEdit adds custom data (to preserve folds).
>>
>>
>
> --
> _______________________________________________
> Lazarus mailing list
> [hidden email]
> https://lists.lazarus-ide.org/listinfo/lazarus
>
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] TESTERS NEEDED / ALL PLATFORMS / COPY AND PASTE / Re: Copy to clipboard from synedit

Free Pascal - Lazarus mailing list
Amazing!
It is clear when looking at your commit but I did not understand the
clipboard issues enough when adding the workaround and
GTK_REMOVE_CLIPBOARD_NULL define.
I guess the define can be removed at some point. Martin, please do
that when all is proven to work.

Juha
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] TESTERS NEEDED / ALL PLATFORMS / COPY AND PASTE / Re: Copy to clipboard from synedit

vojtech.cihak
In reply to this post by Free Pascal - Lazarus mailing list

Hi,

 

I tested with Lazarus 1.9.0 r58530M FPC 3.1.1 x86_64-linux-qt. I tried also with -dDisableUTF8RTL

All works well with two exceptions:

 

1) folded block is copied folded only in implementation section. In interface section become unfolded (for example block TForm1 = class(TForm)...)

 

2) I don't know what is "Column Mode Selection"

 

Vojtěch

______________________________________________________________
> Od: Martin Frb via Lazarus <[hidden email]>
> Komu: [hidden email]
> Datum: 15.07.2018 12:27
> Předmět: [Lazarus] TESTERS NEEDED / ALL PLATFORMS / COPY AND PASTE / Re:
>

On 15/07/2018 12:07, Michael Van Canneyt via Lazarus wrote:
>
>
> It seems a fix is available but needs to be enabled using a define ?


--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] TESTERS NEEDED / ALL PLATFORMS / COPY AND PASTE / Re: Copy to clipboard from synedit

vojtech.cihak
In reply to this post by Free Pascal - Lazarus mailing list

Hi,

 

I tested with Lazarus 1.9.0 r58530M FPC 3.1.1 x86_64-linux-qt. I tried also with -dDisableUTF8RTL

All works well with two exceptions:

 

1) folded block is copied folded only in implementation section. In interface section become unfolded (for example block TForm1 = class(TForm)...)

 

2) I don't know what is "Column Mode Selection"

 

Vojtěch

______________________________________________________________
> Od: Martin Frb via Lazarus <[hidden email]>
> Komu: [hidden email]
> Datum: 15.07.2018 12:27
> Předmět: [Lazarus] TESTERS NEEDED / ALL PLATFORMS / COPY AND PASTE / Re:
>

On 15/07/2018 12:07, Michael Van Canneyt via Lazarus wrote:
>
>
> It seems a fix is available but needs to be enabled using a define ?


--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] TESTERS NEEDED / ALL PLATFORMS / COPY AND PASTE / Re: Copy to clipboard from synedit

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
Am 15.07.2018 um 12:27 schrieb Martin Frb via Lazarus:
> Please try with rev 58530

Tested all your requests on 64bit Windows 7 with 32bit Lazarus and
OpenOffice. No problems, work fine here!

Michl
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] TESTERS NEEDED / ALL PLATFORMS / COPY AND PASTE / Re: Copy to clipboard from synedit

Free Pascal - Lazarus mailing list
In reply to this post by vojtech.cihak
On Sun, Jul 15, 2018 at 3:39 PM Vojtěch Čihák via Lazarus
<[hidden email]> wrote:
> 2) I don't know what is "Column Mode Selection"

Alt-Shift with arrow keys select a column.

Juha
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] TESTERS NEEDED / ALL PLATFORMS / COPY AND PASTE / Re: Copy to clipboard from synedit

vojtech.cihak
In reply to this post by vojtech.cihak

Thanks,

 

column mode works well too.

 

V.

______________________________________________________________
> Od: Juha Manninen via Lazarus <[hidden email]>
> Komu: Lazarus mailing list <[hidden email]>
> Datum: 15.07.2018 15:26
> Předmět: Re: [Lazarus] TESTERS NEEDED / ALL PLATFORMS / COPY AND PASTE / Re:
>

On Sun, Jul 15, 2018 at 3:39 PM Vojtěch Čihák via Lazarus
<[hidden email]> wrote:
> 2) I don't know what is "Column Mode Selection"

Alt-Shift with arrow keys select a column.

Juha
--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] TESTERS NEEDED / ALL PLATFORMS / COPY AND PASTE / Re: Copy to clipboard from synedit

Free Pascal - Lazarus mailing list
In reply to this post by vojtech.cihak
On 15/07/2018 14:39, Vojtěch Čihák via Lazarus wrote:

Hi,

 

I tested with Lazarus 1.9.0 r58530M FPC 3.1.1 x86_64-linux-qt. I tried also with -dDisableUTF8RTL

All works well with two exceptions:

 

1) folded block is copied folded only in implementation section. In interface section become unfolded (for example block TForm1 = class(TForm)...)


Just tested, seems to depend:

if I paste it (folded TForm) into the "type" section, then it works. Otherwise not. That is probably unrelated.

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus