Gripes with Livecode
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Gripes with Livecode
I absolutely love Livecode, but there is one thing that is annoying me so much:
When I copy / paste part or whole or change structure in or around if and end if statements, the alignment goes out.
Sometimes I can just backspace or delete the end if and type it in again and it gets aligned properly again, but usually and especially if you make major changes to the structure (move lots of code around / take end if's out and add and so on) I CANNOT get it aligned properly without typing the whole thing over and then deleting the offending part, and sometimes it is a lot of typing.
Example:
if this or that then
do this
if this or that then
do this
end if -- (do I have to use -- here? haha) <-- Then you can't get this end if to align back properly
end if
Regards,
Carel
When I copy / paste part or whole or change structure in or around if and end if statements, the alignment goes out.
Sometimes I can just backspace or delete the end if and type it in again and it gets aligned properly again, but usually and especially if you make major changes to the structure (move lots of code around / take end if's out and add and so on) I CANNOT get it aligned properly without typing the whole thing over and then deleting the offending part, and sometimes it is a lot of typing.
Example:
if this or that then
do this
if this or that then
do this
end if -- (do I have to use -- here? haha) <-- Then you can't get this end if to align back properly
end if
Regards,
Carel
Re: Gripes with Livecode
press the tabKey to get scripts to format if they are out of line
Re: Gripes with Livecode
I also have some problems when pasting text/scripts from this forum into the script editor!
TABKEY does not help, I need to really delete and replace all CRs and SPACEs to get the script to align correctly.
No idea what is causing this, I guess some hidden (and uncommon to LC) characters, never bothered to find out what exactly.
TABKEY does not help, I need to really delete and replace all CRs and SPACEs to get the script to align correctly.
No idea what is causing this, I guess some hidden (and uncommon to LC) characters, never bothered to find out what exactly.
Re: Gripes with Livecode
Hi Klaus,
somehow when you copy from the forum to the script editor it does not align correctly.
The cause to this seems some ascii 202 in the text which Livecode inserts when pasting. It is not in the forum code. 202 seems to be a non-breaking space.
If you replace ascii 202 with "" in e.g "TextWrangler" on a Mac it will format correctly. (just show invisible characters, do a find/replace for the "bullet" in front of script lines, and copy paste back into Script editor).
I guess one could write a plug-in
the code could be
run this after copying from the forum and before pasting into the script editor.
I was always too lazy to do this but maybe....
Kind regards
Bernd
edited the code to replace the non-breaking space with a space, before it was ""
somehow when you copy from the forum to the script editor it does not align correctly.
The cause to this seems some ascii 202 in the text which Livecode inserts when pasting. It is not in the forum code. 202 seems to be a non-breaking space.
If you replace ascii 202 with "" in e.g "TextWrangler" on a Mac it will format correctly. (just show invisible characters, do a find/replace for the "bullet" in front of script lines, and copy paste back into Script editor).
I guess one could write a plug-in

the code could be
Code: Select all
on mouseUp
put the clipboardData ["html"] into tHTML
replace " " with " " in tHTML
set the clipboardData ["html"] to tHTML
end mouseUp
I was always too lazy to do this but maybe....
Kind regards
Bernd
edited the code to replace the non-breaking space with a space, before it was ""
Re: Gripes with Livecode
I've noticed the same problem when copying from the forums here. I have a Firefox plugin installed that allows me to copy either "plain text" or html text. If I copy the plain text, it formats fine in the script editor. The plugin is called "Extended Copy Menu" if anyone who uses Firefox wants to give it a try.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Gripes with Livecode
here is the rough plugin. Either run it as stack or put it into the plug-in folder to access it from the Development menu-> Plugins
Kind regards
Bernd
Kind regards
Bernd
- Attachments
-
- bnZap202fromClipboard.livecode.zip
- (1.13 KiB) Downloaded 209 times
Re: Gripes with Livecode
Thanks for all the replies.
The problem I have is copying and pasting my own code from different card or handler etc.
I'll try TAB, what Dixie suggested when it happens again.
I generally do not copy and paste from the forum / web. I view on my one screen and type on the other.
Thanks,
Carel
The problem I have is copying and pasting my own code from different card or handler etc.
I'll try TAB, what Dixie suggested when it happens again.
I generally do not copy and paste from the forum / web. I view on my one screen and type on the other.
Thanks,
Carel
Re: Gripes with Livecode
I'm not 100% sure what you mean but if it is what I think then try this:carel wrote:When I copy / paste part or whole or change structure in or around if and end if statements, the alignment goes out.
1. Select in the script editor the whole part of the code that you want to align properly
2. Comment it (Ctrl+- on a PC or Edit>Comment)
3. Uncomment it (Ctrl+_ on a PC or Edit>Uncomment)
keram
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit
Re: Gripes with Livecode
Hi.
Sometimes, and this goes back a long way, if/then constructions may not indent properly when condensed. They always do if expanded fully:
if whatever then
doThis
else
doThat
end if
As opposed to, as just one example:
if whatever then
doThis
else doThat
The handler may compile correctly, but not align. Can you test this? I am not sure if this is your issue, but take one or more of those and test. I have never been able to learn in what context these happen. Sometimes I just fool around until it works
Craig Newman
Sometimes, and this goes back a long way, if/then constructions may not indent properly when condensed. They always do if expanded fully:
if whatever then
doThis
else
doThat
end if
As opposed to, as just one example:
if whatever then
doThis
else doThat
The handler may compile correctly, but not align. Can you test this? I am not sure if this is your issue, but take one or more of those and test. I have never been able to learn in what context these happen. Sometimes I just fool around until it works
Craig Newman