Sublime Forum

Dev Build 2113

#1

Dev Build 2113 is out now.

Code Folding is in this build, but it’s just the basics so far. The relevant key bindings are:

  • Ctrl+Shift+J (Cmd on OS X): Fold/Unfold selection

  • Ctrl+K, Ctrl+J (Cmd on OS X): Unfold all

  • Ctrl+K, Ctrl+T (Cmd on OS X): Fold all tag attributes

Anything can be folded, not just lines: you can see this in action when folding tag attributes. There will be key bindings to collapse functions etc in the future.

There are a couple of new API functions (not yet in the API reference):

  • view.fold(region): returns True iff anything was folded

  • view.unfold(region): returns a list of the unfolded regions. Will be an empty list if nothing was unfolded.

Think of the code folding at this stage as a preview: 2113 was released mostly to get a couple of bug fixes out the door.

0 Likes

#2

I cant believe in we already have (at least basic support) for code folding, i almost give up when you said it could be done only in Sublime3 (iirc).

Thanks a lot, Jon ! All the best for this community, ST2 is a life saver for me daily.

0 Likes

#3

The line/column indicator is already correct…
Even the copy and paste of folded regions work :astonished:

Hat off to Jon… you’re truly unbelievable…

0 Likes

#4

Yay! Thanks for the work Jon!

0 Likes

#5

Awesome! Can’t wait to see this unfold in the next few builds! :laughing:

0 Likes

#6

Thank you for the updates. I tried with vintage mode on using a mac with php and nothing seems to fold. Also in vintage mode when you select using shift + v then using the up key to select the lines above, the line you started on gets unselected which is definitely a bug.

0 Likes

#7

This folding looks great! I’m excited by the implications of non-fixed-width elements in the buffer.
Small bug: if one of the braces in the current pair is folded (and is not the first character in the fold), the next character after the fold-mark gets the underline.

0 Likes

#8

And with this I think I’m off the TextMate train for now, thanks for expending some time working on this. For me this was one of the major flaws that prevented me from even considering moving to ST2 (I work with a lot of code that it’s not mine and folding saves my ass from looking at glaring defects I’m not supposed to work on).

Amazing work.

0 Likes

#9

I. Bloody. Love. You. Jon. :blush:

You know how much I’ve been wanting code folding!!!

0 Likes

#10

One other thing I’ve noticed since a few updates ago, it doesn’t seem to find the gutter images screencast.com/t/WRZ0GPKf

0 Likes

#11

Weird problem that appears to be specific to this build.

Keyboard shortcuts seems to stop working randomly. For example I have ST2 in this state now and when I press Ctrl+Shift+k to remove line I see status message: "Unable to open …/Delete Line.sublime-macro.
Also saving file fails with this message in console:
“error: Unable to save [file name]”
Even saving from File menu does not work so it’s not only about shortcuts.

0 Likes

#12

By any chance with this build did you remove on Mac the Command + Click on the file name in the title bar functionality?

It was really useful!

0 Likes

#13

Nevermind, I found that this is due to the fact that I wasn’t on a project.

0 Likes