Copy and paste in the IDE
Moderator: Klaus
Copy and paste in the IDE
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?
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
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Re: Copy and paste in the IDE
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.
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
-
- VIP Livecode Opensource Backer
- Posts: 10044
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Copy and paste in the IDE
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Copy and paste in the IDE
http://quality.livecode.com/show_bug.cgi?id=20026FourthWorld wrote:Have you reported this to the bug DB?
http://quality.livecode.com/show_bug.cgi?id=20209
http://quality.livecode.com/show_bug.cgi?id=20236
http://quality.livecode.com/show_bug.cgi?id=20240
http://quality.livecode.com/show_bug.cgi?id=11871
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
- VIP Livecode Opensource Backer
- Posts: 10044
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Copy and paste in the IDE
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?
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Copy and paste in the IDE
Can you find in the script editor stack what happen with CTRL+V?FourthWorld wrote: What would you like the other users in this forum to help with?
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
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
-
- VIP Livecode Opensource Backer
- Posts: 10044
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Copy and paste in the IDE
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?
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Copy and paste in the IDE
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!
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!
Re: Copy and paste in the IDE
Maybe I am missing something, but since a long time we have a shortcut (and menuitem in Menu "Edit", of course) for -> Paste Unformatted!
Re: Copy and paste in the IDE
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.
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
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.MaxV wrote: ↑Thu Aug 24, 2017 5:30 pmcopy 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!
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

Re: Copy and paste in the IDE
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.
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.
Re: Copy and paste in the IDE
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
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
Re: Copy and paste in the IDE
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.
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.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: Copy and paste in the IDE
Sorry, I fail to notice the fail

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.
Re: Copy and paste in the IDE
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.
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.