Sign in to follow this  
Followers 0
shEiD

SciTE folding settings by level?

3 posts in this topic

Hi,

I searched the forums but couldn't find anything about this.

Is there a way to set default "folding level" on file open (and/or on toggle all folds). I mean, I have scite set "fold.on.open=1", though it folds only 1st level. It would be most convenient to be able to set default level to fold by. The best example would be IE.au3 from autoit includes. It's separated into regions and opens up very nicely, (all those 4026 lines showing up as mere ~15):

#Region Header
#Region Global Variables and Constants
#Region Core functions
#Region Frame Functions
#Region Frame Functions
etc

The problem is, if I open any region - ALL functions inside are unfolded, and it opens to hundreds of lines. I know about CTRL+click and yes, it helps. The annoying thing about CTRL+click, is that it folds everything, every if, loop, whathaveyou. That drives me crazy :idea:

Pretty much all of my scripts use same structure as IE.au3 (imho, the easiest and tidiest solution - spliting to includes are kinda more trouble). Perfectly there would be setting to make default folding to level 2, so on open file, toggle and tidy, all regions and only functions/comments inside them would get folded, but everything inside the functions would be left unfolded (ifs/loops/etc). That way, I could forget about CTRL+click altogether.

Hope I'm making any sence and you get my meaning.

Thanks in advance.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

There is an option in scite settings: fold.flags.

If you set it to 64 it enables showing hexadecimal fold levels in margin:

Posted Image

It clearly shows all the folding levels, so the "mechanism" is probably already in place. Maybe someone with Lua knowledge could implement this?

Edited by shEiD

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

2 year old post, but I have the same issue. Here is my solution...

Read the last entry by me. It works to close those functions under the selected region. I've also updated it to fold the function descriptions if they're based on the IE.au3 format as well!

Just wish there was a faster/cleaner solution.

Thanks,

Edited by kalel69

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0