[Solved] Option for wrapping Code Editor text and how to remove spaces in field ??
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: [Solved] Option for wrapping Code Editor text and how to remove spaces in field ??
Richard.
There has been much discussion over years that these red dots are fickle. Just some...
viewtopic.php?f=9&t=31570&p=171792&hili ... ot#p171792
viewtopic.php?f=9&t=26117&p=135837&hili ... ot#p135837
viewtopic.php?f=9&t=25111&p=130460&hili ... ot#p130460
Bug 19173, 15830 and many others.
It is on again/off again. It is certainly not solid in v7 and v8. I want to know if it is finally fixed in v9.
Craig
There has been much discussion over years that these red dots are fickle. Just some...
viewtopic.php?f=9&t=31570&p=171792&hili ... ot#p171792
viewtopic.php?f=9&t=26117&p=135837&hili ... ot#p135837
viewtopic.php?f=9&t=25111&p=130460&hili ... ot#p130460
Bug 19173, 15830 and many others.
It is on again/off again. It is certainly not solid in v7 and v8. I want to know if it is finally fixed in v9.
Craig
Re: [Solved] Option for wrapping Code Editor text and how to remove spaces in field ??
I'd guess (since I use 'breakpoint' instead of soft breakpoints) that if this is all that might be affected, wrapping text in the code editor has no downside.
I don't like guessing though, I think i'll run it that way for a few projects and see if i can find any down side to it.
I don't like guessing though, I think i'll run it that way for a few projects and see if i can find any down side to it.

-
- Posts: 128
- Joined: Thu Jun 30, 2016 3:08 am
Re: [Solved] Option for wrapping Code Editor text and how to remove spaces in field ??
@Bogs,
I wish I understood what you are doing. One of the LC issues that drives me more crazy than usual is having to use those "\" at the EOL for every line.
While I'm at it, and this is off topic, another thing that I miss or haven't found is the ability to select several lines of code in the script editor and use shortcut keys to comment the code out. On a mac the IDEs that I'm used to using just let you use a <command></>. So easy.
Does LC have something like that that I have missed? I know about "/**/" I've used it with several languages (dabbled in many but mastered none). I'm glad that LC has it, but IMO it is still less gracious than the shortcut keys.
At some point, I'm going to study your fix and see if I can get it to work for me. I also think it should be a solved topic in itself. Even better would be if there were a few forum stickies around related to questions that get asked over and over. Gee, I'm the opinionated one today.
-Rachel
I wish I understood what you are doing. One of the LC issues that drives me more crazy than usual is having to use those "\" at the EOL for every line.
While I'm at it, and this is off topic, another thing that I miss or haven't found is the ability to select several lines of code in the script editor and use shortcut keys to comment the code out. On a mac the IDEs that I'm used to using just let you use a <command></>. So easy.
Does LC have something like that that I have missed? I know about "/**/" I've used it with several languages (dabbled in many but mastered none). I'm glad that LC has it, but IMO it is still less gracious than the shortcut keys.
At some point, I'm going to study your fix and see if I can get it to work for me. I also think it should be a solved topic in itself. Even better would be if there were a few forum stickies around related to questions that get asked over and over. Gee, I'm the opinionated one today.

-Rachel
May I never be cured of my curiosity! 

Re: [Solved] Option for wrapping Code Editor text and how to remove spaces in field ??
Well, what I'm doing isn't so mysterious really, you have been using Lc for a while and playing with fields. When you have a field, one of the properties you can 'set' or 'unset' is the dontWrap, which simply tells the field whether lines of text wrap or not at the end of the field. The script editor isn't much more than a field and a few buttons and a few groups (I won't take you down the whole shebang, I don't think I'll live long enough for that descriptionValiantCuriosity wrote: ↑Sat Mar 16, 2019 10:15 pmI wish I understood what you are doing. One of the LC issues that drives me more crazy than usual is having to use those "\" at the EOL for every line.

I was intrigued by your question about wrapping (it has been asked before as well), so I wanted to see if there was any downside to letting the lines wrap. Since I don't mind warping my stuff, I just opened the Message box while the script editor was open, and typed in
Code: Select all
set the dontWrap of field "Script" of group "Editor" of card "Main" of stack "revNewScriptEditor 1" of stack "/home/bogs/.runrev/components/livecodecommunity-6.5.2/Toolset/revscripteditor.rev" to false


Pretty easy in Lc as well, go to the code editor -> Edit menu -> look for "Comment". On here, it is [ctrl + _], probably not much different on mac, maybe cmd + _ or some such.ValiantCuriosity wrote: ↑Sat Mar 16, 2019 10:15 pmWhile I'm at it, and this is off topic, another thing that I miss or haven't found is the ability to select several lines of code in the script editor and use shortcut keys to comment the code out. On a mac the IDEs that I'm used to using just let you use a <command></>. So easy.
Have fun, I'm off to supper


-
- Posts: 128
- Joined: Thu Jun 30, 2016 3:08 am
Re: [Solved] Option for wrapping Code Editor text and how to remove spaces in field ??
Ahhhhh, @Bogs. I missed the forest for all of the trees...or maybe it is the other way around. Thank you for that information on the shortcut key. What a relief!
Oh, and "Yes", it is about the same on the Mac. Also, very KOOL about the script editor. I will give it a try.
-Rachel
Oh, and "Yes", it is about the same on the Mac. Also, very KOOL about the script editor. I will give it a try.

-Rachel
May I never be cured of my curiosity! 

Re: [Solved] Option for wrapping Code Editor text and how to remove spaces in field ??
I almost forgot, you won't need to copy that message box command exactly (since it ultimately points to a folder on my drive, it won't work for you in its full form).
This however *should* work for you just fine (tested as far up as 8.1.2) -
If you start getting weird results from your code, first recommendation would be to run that same line with "true" instead of false 
This however *should* work for you just fine (tested as far up as 8.1.2) -
Code: Select all
set the dontWrap of field "Script" of group "Editor" of card "Main" of stack "revNewScriptEditor 1" to false


-
- VIP Livecode Opensource Backer
- Posts: 10049
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: [Solved] Option for wrapping Code Editor text and how to remove spaces in field ??
Thanks for the info, Craig.dunbarx wrote: ↑Sat Mar 16, 2019 5:40 amRichard.
There has been much discussion over years that these red dots are fickle. Just some...
viewtopic.php?f=9&t=31570&p=171792&hili ... ot#p171792
viewtopic.php?f=9&t=26117&p=135837&hili ... ot#p135837
viewtopic.php?f=9&t=25111&p=130460&hili ... ot#p130460
Bug 19173, 15830 and many others.
It is on again/off again. It is certainly not solid in v7 and v8. I want to know if it is finally fixed in v9.
The bug report numbers are useful; the discussion links less so. With all due respect to my colleagues here, if an issue is worth complaining about it's worth filing a bug report. Bug reports are how problems get solved, so that's where I tend to focus my time.
Of course there may be times when a recipe is uncertain, and discussing it here can be a useful step toward submitting a recipe for a bug report. Happy to help triage those, but until they result in a bug report they're not actionable.
As for the bug reports you cited:
https://quality.livecode.com/show_bug.cgi?id=19173
This one is confirmed, but the core dev working on it, Panos, could only reproduce it with the sample stack provided, and could not reproduce it in any other stack. Definitely an odd case worthy of investigation, but appears to be specific to a single stack file, suggesting the root cause is a subtle form of extremely rare stack file corruption, and given the age further limited to older stacks brought forward to newer versions. It does not appear to be a generalized issue preventing use of the Script Editor's breakpoints feature.
https://quality.livecode.com/show_bug.cgi?id=15830
This one was resolved two and half years ago, included in v9.0 and later. Only those using older engine versions will be affected by this bug. And since more than 150 other fixes have been included in the v9 series, that's far from the only issue one will encounter when using older engine versions that are missing out on years of fixes and enhancements.
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: [Solved] Option for wrapping Code Editor text and how to remove spaces in field ??
Every line? A carriage return is the usual end of line delimiter. You only need a backslash if you want to wrap a particularly long line. If I find I need to do that more often than not, a quick fix is to make the editor window wider.One of the LC issues that drives me more crazy than usual is having to use those "\" at the EOL for every line.
Let's see how Bogs does with his experiment. I don't think I'd trust it yet, and it wouldn't help you to run into problems so early in the learning curve.
I'd be curious to know what type of line requires such frequent wrapping in your code.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 10049
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: [Solved] Option for wrapping Code Editor text and how to remove spaces in field ??
AFAIK the engine doesn't care how long a script line is (within certain reasonable limits, at least 64k, perhaps longer). You could put all the statements on a single line separated with ";" if you wanted to. But if any employee or contractor submitted code like that to my office I wouldn't use them again.
Obviously no one will do that for an entire script. But the difference between an entire script and a few lines is only a matter of degrees. If I'm doing code review, or dealing with a bug report, I want to be able to refer to a line number and know what line that is in the script as displayed.
So while we could dismiss the line number list as merely cosmetic, doing so overlooks the utility it provides. Every good script editor has line numbers for a reason. To make a choice which reduces or eliminates the utility of line numbers reduces programmer productivity.
That said, it's not impossible to craft a line numbering system which could account for soft wraps. But it's non-trivial, and those concerned about the performance of LC's Script Editor today would be no less happy to have it slowed down further with the additional calculations needed for updating a line number list to account for soft wraps.
Like so many things in LC, what's possible is vast. For me, the more relevant question is what's useful.
Given the nature of scripting, there's a reason why most languages have a line continuation character. If I just use that for the occasions when I have a line too long to fit comfortably on screen, the problem is immediately solved and I get to move on to bigger challenges.
Obviously no one will do that for an entire script. But the difference between an entire script and a few lines is only a matter of degrees. If I'm doing code review, or dealing with a bug report, I want to be able to refer to a line number and know what line that is in the script as displayed.
So while we could dismiss the line number list as merely cosmetic, doing so overlooks the utility it provides. Every good script editor has line numbers for a reason. To make a choice which reduces or eliminates the utility of line numbers reduces programmer productivity.
That said, it's not impossible to craft a line numbering system which could account for soft wraps. But it's non-trivial, and those concerned about the performance of LC's Script Editor today would be no less happy to have it slowed down further with the additional calculations needed for updating a line number list to account for soft wraps.
Like so many things in LC, what's possible is vast. For me, the more relevant question is what's useful.
Given the nature of scripting, there's a reason why most languages have a line continuation character. If I just use that for the occasions when I have a line too long to fit comfortably on screen, the problem is immediately solved and I get to move on to bigger challenges.
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: [Solved] Option for wrapping Code Editor text and how to remove spaces in field ??
I'd certainly say that if your lines are consistently that long Rachel, then the problem is the construction of the line. Some examples might be -
Code: Select all
put "some text longer than a little sentence should not be entered into a field in code" into field "MyGinormousFieldOfInfinity" of card "HolyCowHowMuchLongerMightThisGoOnFor" of stack "myFingersAreNowKnubs"

Most script lines rarely have to be long enough to require wrapping.
*Edit - Well, really you can't run into any big problems, because it vanishes when you quit the IDE

Yah, although I don't see an issue doing this (so far), it has hardly been a long enough time working with it to even think I caught a fraction of what *might* happen. Part of the problem is what Jacque and I have both said, we rarely run into lines long enough to require continuation.
I'd love to see an example of the code your writing that makes wrapping handy to have though, it is possible that we can help refine your coding style

As far as I can tell, wrapping it in my script editor doesn't seem to affect opening it in any other script editor, so not sure that would be a problem or not *(one of the many not completely tested elements of wrapping).Obviously no one will do that for an entire script. But the difference between an entire script and a few lines is only a matter of degrees. If I'm doing code review, or dealing with a bug report, I want to be able to refer to a line number and know what line that is in the script as displayed
@ Richard - I spent the morning testing 9 . stable to 9. rc2, and found (no surprise) they don't run well on my box outside of a vm. I did submit 2 new reports, append one other report I had previously submitted, and added a comment to a report submitted from vers. 6 that appears to be a regression in 9.x. Most of the above concern the PB.

-
- VIP Livecode Opensource Backer
- Posts: 10049
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: [Solved] Option for wrapping Code Editor text and how to remove spaces in field ??
Unless you're communicating with other team members, such as in a code review or bug reporting process.bogs wrote: ↑Sun Mar 17, 2019 8:13 pmAs far as I can tell, wrapping it in my script editor doesn't seem to affect opening it in any other script editor, so not sure that would be a problem or not *(one of the many not completely tested elements of wrapping).Obviously no one will do that for an entire script. But the difference between an entire script and a few lines is only a matter of degrees. If I'm doing code review, or dealing with a bug report, I want to be able to refer to a line number and know what line that is in the script as displayed
Thanks for submitting those reports. #s?@ Richard - I spent the morning testing 9 . stable to 9. rc2, and found (no surprise) they don't run well on my box outside of a vm. I did submit 2 new reports, append one other report I had previously submitted, and added a comment to a report submitted from vers. 6 that appears to be a regression in 9.x. Most of the above concern the PB.
FWIW, the PB fully optional. The App Browser from earlier versions is still available, now as a plugin. There are several other alternatives in the community as well. The v9 engine is lovely, worth enjoying. And since it's the only version currently in maintenance until v10 comes out, any bug report will need to be tested against it anyway.
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: [Solved] Option for wrapping Code Editor text and how to remove spaces in field ??
Ugh, I knew I forgot something this morning

You know me, if it is what *ships* with the environment, then it should be usable. New comers to languages aren't going to know about plugins, heck, plugins took me a long time to figure out.FourthWorld wrote: ↑Mon Mar 18, 2019 6:02 amFWIW, the PB fully optional. The App Browser from earlier versions is still available, now as a plugin. There are several other alternatives in the community as well. The v9 engine is lovely, worth enjoying.
As to how lovely the engine is, I may never know. I already don't use new versions with any regularity, but 9 is impossible to use on my system, and even 8.1.2 is flaky/erratic at best. Oddly enough, 8.0.1 seems to work more or less.
I opened 9 today to look for any changes in the IDE for that project we were talking about, I made a stack, dragged a browser widget to the stack, the widget didn't show up on the card.
Confused, I went to the PB. the PB was locked up. I tried to drag another browser widget to the card. That one showed up, but in a wierd goofy way, it actually looked like it was sitting in the first browser widget spot, behind a rectangle the size that one would have been, and when I moved it around, the spot 'eclipsed' it.
As a bonus, every other part of the IDE stopped working, I couldn't select anything else, there were no open dialogs. I couldn't even quit out of the IDE, although the menu still worked for some reason, clicking on quit did nothing?
I then closed the stack with the close [x] control, which worked for closing it, and sitting on my desktop was the original browser widget. I'd still love to know how that happened
Then there were the problems with the PB, as shown in this video. If the video isn't self explanatory, selecting objects on the card doesn't allow them to align in the PB, and even selecting them in the PB doesn't allow horizontal or vertical alignment. Going to the alignment pane in the PI seems to work though, however my testing wasn't rigorous after 2 force quits.
I attached screen shots of the other issues with 9 to the bug reports I submitted this morning, and the 'launch after installing' issue does seem to finally have been fixed so there is some good news I guess.

-
- VIP Livecode Opensource Backer
- Posts: 10049
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: [Solved] Option for wrapping Code Editor text and how to remove spaces in field ??
Curious.
Which distro and version?
And installed RAM?
Which distro and version?
And installed RAM?
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: [Solved] Option for wrapping Code Editor text and how to remove spaces in field ??
This box is running MX 18, rams 4 gigs, the LC versions that don't work on it are pretty much late 8.1x to the latest release candidate. I have 2 vms that will likely be dedicated to any screen shots I need, or if I found some dire need for a newer version of Lc, I just haven't ever found that compelling need yet.
Side note, the vms which run later versions smoother (but still not perfect) have less than 98% cpu execution cap and > 1 gig ram assigned.
Side note, the vms which run later versions smoother (but still not perfect) have less than 98% cpu execution cap and > 1 gig ram assigned.

-
- VIP Livecode Opensource Backer
- Posts: 10049
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: [Solved] Option for wrapping Code Editor text and how to remove spaces in field ??
Interesting. I've never used MX before, and while it's not an officially supported distro would be good to see if we can pin down the issue so it could become community-supported.
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