Sublime Forum

Open files without auto-expanding all previously collapsed sections

#1

Is it possible to open a file, without the file automatically expanding all previously collapsed indented sections?
Have a file with 5,000 lines of code, where only few sections are worked on at any given time, and all else is minimized/collapsed to keep out of view.

When opening the file, it loses the history of what section was expanded or collapsed… making it difficult to find the areas that we had kept open for quick access.

My current only option is to keep the file open at all times, and make sure the computer doesn’t auto-exit Sublime when going into screensaver/sleep mode. Otherwise, if Sublime closes, next time same file is opened will result in ALL copy being automatically expanded in full.

0 Likes

#2

You could try to install the package:

  1. https://github.com/titoBouzout/BufferScroll

Which remember several settings of a files closed, and restore them later after opening the file again, however Sublime Text has some bug with folding:

  1. https://github.com/SublimeTextIssues/Core/issues/1815 Remember nested folding state
  2. https://github.com/SublimeTextIssues/Core/issues/1499 Code folding inconsistencies between ST2 and ST3

Then even after installing the BufferScroll package, it could not remember the folding state correctly. But you can try installing it and up vote the issues on the GitHub issue tracker.

0 Likes