Sublime Forum

How to always show code folding arrows?

#1

How to always show code folding arrows on the left hand bar? Currently, when you want to fold or unfold using the arrows, it appears then disappears. That’s highly problematic, because it requires one mouse movement to reveal the arrows, then a second mouse movement to navigate over the arrows. IF I can see it at all times, then it only requires one mouse movement to get the cursor directly over the arrow.

I noticed this program doesn’t seem to have a basic settings window? When clicking settings, it actually opens a file that you have to edit? What? Are we back in the MS-DOS times of the 1990’s? lol

0 Likes

#3

For the benefit of others that might come across this in the future:

  1. Preferences > Settings in the menu
  2. Copy the fade_fold_buttons setting from the left to the right
  3. Change value to false and save the file.
2 Likes

#4

Thank you! You wouldn’t happen to know how to make Sublime Text preserve sub folds within a top level fold?

Whenever I unfold a top level fold, it also unfolds all the subfolds within it.

THis is a catastrophic oversight, almost defeating the entire purpose of folding. This means I’ll be forced to use notepad++, but notepad++ only has indentation text folding when language is set to python, and the spellcheck completely doesn’t work right. I was hoping to rid myself of notepad++.

Sublime text does so many things right with folding, but this one oversight is catastrophic.

EDIT: I think i know a work around, I just have to get good at using CTRL K & CTRL # buttons.

0 Likes

#5

Folding is currently done on an indentation basis in Sublime, and in addition to that the sub-fold status is effectively lost when you fold an outer region. Or if you will, what is tracked is “the document is folded from this offset to this offset”.

As such, currently this is not possible without the aid of a plugin of some sort that remembers the fold history so that it can restore it back, though off the top of my head I’m not aware of any.

The folding by indentation is a known limitation however. I believe there’s an issue for it on the tracker though I’m not in a position to search at the moment. Making indentation be syntax based and not indentation based (which I gather was inherited from TextMate) is in the works, though I don’t think there’s been an expressed ETA for that.

1 Like

#6

Thanks again for response. Good to know.

It seems there is a plugin available that might remember subfold status. It’s called:
https://packagecontrol.io/packages/AutoFoldCode

EDIT: I installed it. It’s a useful plugin, but it does not remember subfolds, and unfolding a top level fold still results in subfolds being unfolded. sigh Gotta keep researching to overcome this catastrophic problem.

0 Likes

#7

Hmm… I can see it here:

image

Do you see any errors in the Sublime console (View > Show Console?). The most common reason for not seeing a package in the list is if it’s already installed, since the list will only show you packages you can install. Package Control: List Packages will show you the packages that are currently installed; also Package Control: Enable Package will show you a list of packages that are currently installed but disabled and let you enable them, in case the package is already present but disabled.

1 Like

#8

I was being dumb. I had no idea you had to do “install packages” first.

I’m very very spoiled, I’m not used to this linux way of thinking, it’s fascinating though. I feel like a hacker or something.

Notepad++ spoiled me by making everything so easy to do, but it fails in the folding department.

EDIT: Unfortunately autofoldcode does not remember subfolds.

EDIT: If anyone finds this post and you’re looking for advanced folding, https://packagecontrol.io/packages/OrgExtended seems best. It has powerful folding features, in addition to many other features. It’s basically EXACTLY what I was looking for (I think).
https://github.com/ihdavids/orgextended_docs/blob/master/folding.org

EDIT: Uggh, it looks like OrgExtended also unfolds all subfolds when you unfold the top level fold, i think i’m gonna have to go back to notepad++, this sucks.

0 Likes

#9

Aaah I came to this post late, and it seems everyone’s/I’ve come to the same conclusion I/everyone did earlier/later…oh well.

0 Likes