Copy and paste in the IDE

If you find an issue in LiveCode but are having difficulty pinning down a reliable recipe or want to sanity-check your findings with others, this is the place.

Please have one thread per issue, and try to summarize the issue concisely in the thread title so others can find related issues here.

Moderator: Klaus

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Copy and paste in the IDE

Post by MaxV » Thu Aug 24, 2017 5:30 pm

Hi,
copy and paste in the IDE is a mess from 8.x to now. The IDE continue to crash or copy invisible chars.
The problem is that the paste commad doesn't paste the pure text, but always the Styled/html creating a disaster. Sometime you can't even copy code from a button to another!
Why should I want to copy "styled" text when I wrote code?
Why should I want to copy "styled" text when I type in the code editor?
Why should I want to copy "styled" text when I type in the property inspector?
Why should I want to copy "styled" text when I type in the message box?

Why this bug is still around?
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Re: Copy and paste in the IDE

Post by [-hh] » Thu Aug 24, 2017 9:30 pm

This is certainly not a bug. "Invisible" chars are not part of a "style", rather originating from typing and/or from defunct hardware (keyboard).

Also, starting from LC 8 you have the fullClipboardData and the rawClipboardData available. You could simply use the plain text from there, at least for creating a "recipe" for a report.
shiftLock happens

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10044
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Copy and paste in the IDE

Post by FourthWorld » Thu Aug 24, 2017 9:37 pm

Have you reported this to the bug DB?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Copy and paste in the IDE

Post by MaxV » Fri Aug 25, 2017 10:52 am

Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10044
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Copy and paste in the IDE

Post by FourthWorld » Fri Aug 25, 2017 3:40 pm

Thanks. Those appear to be separate issues. All but the last one, which is still seeking a recipe, are in progress. The second one has a pull request, suggesting it's been done.

Given that those are already in progress in the bug DB, that would seem an ideal place to continue triage/resolution efforts


What would you like the other users in this forum to help with?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Copy and paste in the IDE

Post by MaxV » Mon Aug 28, 2017 9:48 am

FourthWorld wrote: What would you like the other users in this forum to help with?
Can you find in the script editor stack what happen with CTRL+V?
Can you set to paste just the pure ASCII text?
The problem is that it pastes text color, font, styles, tags, whatever and so it create a mess.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10044
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Copy and paste in the IDE

Post by FourthWorld » Mon Aug 28, 2017 5:27 pm

That does not appear to be among the bug reports you listed above.

What is the number of this bug report on pasting plain-text only?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am

Re: Copy and paste in the IDE

Post by sphere » Wed Oct 11, 2017 8:32 pm

HI,
i'm experiencing the same in LC8.1.6 (and seen before in older versions).
But not in LC8.1.7rc3 here i can use CTRL-C and CTRL-V

Does it really mean it solved as mentioned in bugreport (the highest nr in the message above) ?
It mentiones LC8.2.0dp2

then i quit using LC8.1.6

thanks!

Klaus
Posts: 14189
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Copy and paste in the IDE

Post by Klaus » Wed Oct 11, 2017 9:37 pm

Maybe I am missing something, but since a long time we have a shortcut (and menuitem in Menu "Edit", of course) for -> Paste Unformatted!

bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Copy and paste in the IDE

Post by bogs » Thu Oct 12, 2017 2:38 pm

A lot of text editors (well, on linux, I don't know elsewhere), also have that option Klaus, but I suspect from his wording that Max is looking for it to copy unformatted using ctrl + c, and paste unformatted when using ctrl + v (command-c and command-v on mac) within the script editor.
MaxV wrote:
Thu Aug 24, 2017 5:30 pm
copy and paste in the IDE is a mess from 8.x to now. The IDE continue to crash or copy invisible chars.
The problem is that the paste commad doesn't paste the pure text, but always the Styled/html creating a disaster. Sometime you can't even copy code from a button to another!
I actually think his argument is cogent, the raw copy/paste should be raw, styling should only be added after the fact, using the tab key or automatically after being applied to the object, without having to go to an additional menu -> click step.

After all, he is working in the tool that created the script to begin with, it should understand how to paste it simply. Just my .02
Image

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1232
Joined: Thu Apr 11, 2013 11:27 am

Re: Copy and paste in the IDE

Post by LCMark » Thu Oct 12, 2017 6:43 pm

This really needs a bug report with a recipe and appropriate platform information so we can look into it explaining precisely what the issue is, because the initial post isn't clear at all.

The Script Editor uses styled text for colorization - I'd assert that it is useful that it copies this to the clipboard because you then get a replication of how the code looks when you paste it elsewhere. If you are pasting into a plain-text editor, then the styles get stripped.

The message box now colorizes, so is the same case as above.

Indeed in both the above cases, those components *should* be reprocessing any pasted text to reapply syntax highlighting and colorisation (or remove it if those are disabled), so whatever format the text on the clipboard is in should be irrelevant. (Indeed, I don't seem to be able to reproduce the problem on Mac, even with formatting/colorization turned off...)

In regards to the Property Inspector, then where are you pasting styled text into? There might be some friction there - as, since the PI is written in LiveCode, it uses LiveCode fields which are styled-text capable. There are probably cases where fields in the PI should reprocess the text to strip styles - is that the crux of the matter here?

In regards to general LiveCode fields (e.g. in User Apps), then as Klaus points out, there is a Paste Unformatted option for use in the IDE (which is standard in Apps which have by-default styled fields). That being said, there is certainly a useful engine enhancement here - being able to set a property on a LiveCode field to say "don't use styling" - that would mean you wouldn't have to code such a process yourself in your own apps.

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am

Re: Copy and paste in the IDE

Post by sphere » Thu Oct 12, 2017 7:50 pm

Ok maybe i'm missing the point here.
But what i experience is :
copy a piece of script in the script editor using ctrl-c
paste it somewhere else in the script editor using ctrl-v
using lc8.1.6 in windows 7 Pro (and i'm sure i had it a longer time ago, but then i believe it was solved deleting the c:\users\me\appdata\romaing\runrev\preferences\livecode7.rev)
Did this now again but it did not help.

Using the same stack in lc8.1.7rc3 copy/paste using ctrl-c and ctrl-v is working ok

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Copy and paste in the IDE

Post by mwieder » Wed Jan 11, 2023 2:40 am

So... I realize this thread is a bit old and I'll go try to file a bug report, but this seems like another good place to post this.

Recipe:
Copy some code from the script editor.
[Optional] verify that the clipboarddata has what you expect.
Paste into this forum.
Notice the fail.

Workaround:
Paste into a text editor first, then come back here and paste.

What I'd expect is that the clipboardData[text] would contain some plain text, and that I could paste it here.
On inspection of the clipboardData[text] that's what it looks like.

stam
Posts: 3069
Joined: Sun Jun 04, 2006 9:39 pm

Re: Copy and paste in the IDE

Post by stam » Wed Jan 11, 2023 3:48 am

mwieder wrote:
Wed Jan 11, 2023 2:40 am
Notice the fail.
Sorry, I fail to notice the fail ;) It all seems to work normally for me.

I copied a lengthy piece of code from the SE, as indeed I've done many times before, and it pasted it into the forum, with no issues, as expected.

FYI : I tested LC 9.6.9 RC2 on MacOS Ventura 13.1 (but previously have done exactly on earlier versions of LC/MacOS/intel Macs with no issue)

What OS/Version are you using? What issue are you encountering?

S.

SparkOut
Posts: 2944
Joined: Sun Sep 23, 2007 4:58 pm

Re: Copy and paste in the IDE

Post by SparkOut » Wed Jan 11, 2023 8:33 am

The copy/paste issue used to be a very big thing on Windows in the (practically unusable) Script Editor of LC versions 8.x
Usually the problem manifested the other way though - needing to copy/paste into Notepad and then copy/paste from Notepad to the SE.
Thankfully those days are long in the past - there are some SE quirks at times still, but the LC Team did make steady improvements to the SE.
Hopefully I will get chance this evening to try out pasting from the SE.

Post Reply