Script Editor should save which folds are collapsed and expanded within/between sessions

If I want to collapse certain folds, I want them to stay collapsed. I don’t want to have to collapse them all over again every time I close the script and open it again.

20 Likes

This was kind of asked before, but you may not be pleased with the “solution”:

Perhaps the idea needs revisiting.

Hi,

My experience as a Programmer using RobloxStudio’s Script Editor is quite a nuisance compared to other Platforms and Editors;

Currently the Script Editor will not save the status of Script Folds after or even during the session, if you reopen the script all folds are expand.


Adding this would increase quality of the Script Editor and improve User Experience, and would also save Developers time and provide easier organization, currently to avoid scrolling over a huge script with a lot of Content, you can either deal with it or create another script which isn’t very optimal.



10 Likes

Functionality like this would make settings module scripts in free models much more intuitive to new users since they will not be bothered so much by syntax characters and can look more at the direct hierarchy of the script / table within the script. (Not that this is really that important since it’s probably better that new users are exposed to code format anyways)

The issue I could see with this is how exploiters could publish models, close flaps with malicious code in them, and the person who inserted the model doesn’t see the closed flap because the script is 4000 lines long, allowing a backdoor.

Both of these would be prevented if folds didn’t save with the model, and instead only saved in studio for the next time that you open the script, which I think is what you’re asking for but I just wanted to clarify.

Additionally something like this would so nice that folds would become less relevant anyways:

The outline lets you select global functions and variables in your code and easily navigate large scripts. It’s in about every other script editor so I don’t see why it wouldn’t be in roblox

I understand your concern and I appreciate the thought,

Firstly to prevent malicious code there can be a setting which is On by default to Expand all folds when importing Code from the Toolbox, and such.

However in general saving the folds status to our Game file both Online and Offline would be great, I am not sure about how multiple user sharing and editing, Teamcreate, Packages, should work in this regard but it’s their job to figure it out.

3 Likes

Recently I made a post about this, then a post approver informed that a topic like this already exists, that’s why I wanted to add up to this feature, and hopefully revive it, because this is from like 2016.

At the moment this is quite annoying, especially if you have a huge chunk code that you wanna forget about for a long time when dealing with other stuff in that script.

When a scope is closed like this
RobloxStudioBeta_XeupxxLGjg
If I close this project then I open it, or hit play then stop the game and go back to the script, it’s opened.
image

Can this please be changed so It stays the same even after opening it again?

When you are working on a script, you have the option to click a little triangle on the side of the screen next to the line numbers to collapse the following block of code. This is super useful for making a giant script much easier to compartmentalize and manage individual sections without easily getting lost in the code. I find this especially useful for collapsing entire functions in modulescripts that often contain dozens of functions.

The problem with this (or what I believe Roblox Studio currently lacks and desperately needs) is the ability to remember which of these blocks you have expanded and collapsed. Whenever you close out and reopen a script, all of the blocks which you had collapsed are re-expanded, which makes it difficult to continually work on one script over multiple sessions without having to remind yourself which section of code you were working on.

Yep, still in need of this. My character script is at 250 lines right now, with most of it just being bulky sanity checks and input bindings. It will probably reach 600 by the time I’m done and it already takes me 5 minutes to set up the environment to start working.

I’m currently forced to write an API documentation for each script that barely has 8-9 methods (which often change as I work), just because I’d have to scroll down every time instead of folding the functions.

I would actually use the fold collapse feature if collapsedness saved. Currently, it’s just too much of a hassle to bother. It would make it much easier for me to navigate my code if I could just hide and leave hidden stuff I don’t care about.