Open evandrocoan opened 7 years ago
Duplicate/related to https://github.com/SublimeTextIssues/Core/issues/1175. Feel free to close the issue started by me, since this one has a screencast.
I prefer this over the other, because it more clearly describes what is needed ("remembering nested fold states" rather than "unfold one level at a time").
+1 from me on this.
Although the issue has a Minor label, I believe this is rather important for anyone using Sublime with a heavily stacked code.
I've been struggling for weeks with this as I am working on a deeply nested codebase. Code folding on inner levels has become rather pointless since once you fold & unfold the parent - it's gone.
Please implement this!
Yes, I have a similar problem. I work with text with quite a lot of nested indents which are lost of folding / unfolding the top level line.
Please implement! Thank you.
+1 here!
This feature is very useful for non-code uses as well. I like to use Sublime Text to write "interactive text documents" - using nesting to create headers/sub-headers to make a document very easy to navigate on just a small area of the screen even when there is a lot of text in it.
Please enable some sort of persistence for nested code folding, or even just a modifier key to let us unfold just the one block and not it's children.
This is really the only major problem with sublime, and I'm surprised that it's been open for 4 years now and still not addressed. This would be a life saver for a good chunk of the community. Please add this!
+1 here I'm new to this, is the +1 here how i upvote? Yeah, i really wish folding was remembered, or at the very least, defaulted to folded. Ideal is that the child states are remembered, but if we don't get that I'd prefer to manually unfold what i need, then to manually refold all that i don't need.
The following does not resolve the issue, but it may band aid the situation for some!
I have been using AutoFoldCode - a package which remembers the fold state on exit and then reapplies that state when Sublime text is run.
It is not flawless, but I've had a good experience using it for some time now!
How has this not been fixed? Code folding is effectively useless without this feature
I was about to switch from Notepad++ to Sublime Text, but not resolving this issue is a deal breaker.
Does anyone know of a plugin for sublime text that resolves the catastrophic issue explained in the issue up above?
No, nothing really works.
I switched from notepad++ to sublime because notepad++ didn't work with very large files (multi-metabyte). I still miss their way of handling code folding. =/
On Thu, Jun 3, 2021 at 1:54 PM henvu50 @.***> wrote:
I was about to switch from Notepad++ to Sublime Text, but not resolving this issue is a deal breaker.
Does anyone know of a plugin for sublime text that resolves the catastrophic issue explained in the issue up above?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sublimehq/sublime_text/issues/1815#issuecomment-854136217, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABP7MZ32HTGO7T2FKG3XJKLTQ7MWHANCNFSM4DTB4BUA .
i'm currently trying ultraedit to see if it can fold text. i can't eblieve something so fucking simple has not been solved yet, i'm so pissed On Thursday, June 3, 2021, 01:08:40 PM PDT, pjmattingly @.***> wrote:
No, nothing really works.
I switched from notepad++ to sublime because notepad++ didn't work with very large files (multi-metabyte). I still miss their way of handling code folding. =/
On Thu, Jun 3, 2021 at 1:54 PM henvu50 @.***> wrote:
I was about to switch from Notepad++ to Sublime Text, but not resolving this issue is a deal breaker.
Does anyone know of a plugin for sublime text that resolves the catastrophic issue explained in the issue up above?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/sublimehq/sublime_text/issues/1815#issuecomment-854136217, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABP7MZ32HTGO7T2FKG3XJKLTQ7MWHANCNFSM4DTB4BUA .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
Guys, my apologies for using foul language. That was actually from an email I sent, but it somehow ended up here! I did not type that foul language here. Apologies.
Guys, my apologies for using foul language. That was actually from an email I sent, but it somehow ended up here! I did not type that foul language here. Apologies.
We should not diminish those who care about their tools or craft. It shows passion!
I found this issue when looking for a whether a bug has been reported in the cmd-K, cmd-
Also really need this
It is hard to believe that an editor this powerful does not support this feature (and for so long).
+1, switching to Obsidian for note taking solely for this feature. Obsidian lacks a lot of stuff Sublime has though, so I'll switch back if implemented.
+1 Please consider implementing!
+1, switching to Obsidian for note taking solely for this feature. Obsidian lacks a lot of stuff Sublime has though, so I'll switch back if implemented.
I first left sublime in favour of the free and more popular vscode. then i've more recently moved note taking to obsidian, and kept code with vscode. i now only use sublime very rarely. and i remember one of the features of sublime i prefered over vscode was the auto complete. But i believe they changed it to be more inline with the common way of doing it which i dislike.
Guys, it's been 6 YEARS !
This is part of almost all (if not all) other IDEs out there. This is achievable through a plugin, so it's definitely not something hard or super time consuming to implement from your end, right into the official release.
6 years is enough time to ignore something major like this! Time to remove that "minor" tag and spend a couple of days working on this (and I know for a fact it's not going to take more than that, my own plugin which does this took me less than 2 work days)
@xPh03n1x - Is your plugin publicly available? I'd love to use it!
@mattcrichards
@xPh03n1x - Is your plugin publicly available? I'd love to use it!
Too bad I didn't see your message earlier. I got annoyed by Sublime and after I saw that VS Code does everything I need - I just deleted my Sublime directly, including the themes and plugins I had.
I am not going back to Sublime for sure.
I appreciate the response!
On Fri, Oct 20, 2023 at 9:31 AM John Jamesson @.***> wrote:
@xPh03n1x https://github.com/xPh03n1x - Is your plugin publicly available? I'd love to use it!
Too bad I didn't see your message earlier. I got annoyed by Sublime and after I saw that VS Code does everything I need - I just deleted my Sublime directly, including the themes and plugins I had.
I am not going back to Sublime for sure.
— Reply to this email directly, view it on GitHub https://github.com/sublimehq/sublime_text/issues/1815#issuecomment-1772851673, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATWJSEUB43MHYNK5DAZU3I3YAKDLLAVCNFSM4DTB4BUKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZXGI4DKMJWG4ZQ . You are receiving this because you commented.Message ID: @.***>
It would be cool if github automatically prioritized issues based on number of comments, and general activity. I'd take it a step further and pay developers per issue/ticket instead of salary/hourly.
i am annoyed AF that it is not supported
if anyone have a python script for this feature please share, i'm not going to invest time doing it myself
i'm tired and want to focus on working on my game instead of being a free worker
Actually.. i'll try to make a plugin for it, i'll fight for great features, i'll share it here
Neither sublime or obsidian ended up having this feature for me. VS code + the Project Manager extension has it though.
@ryuukk Any updates? Is it really possible to change the folding behaviour via a plugin?
There is an API, but from my experimentation with it, it has the same problem as the builtin fold command: https://www.sublimetext.com/docs/api_reference.html
>>> view.fold(sublime.Region(5, 8))
True
>>> view.fold(sublime.Region(5, 8))
False
>>> view.unfold(sublime.Region(5, 8))
[Region(5, 8)]
>>> view.unfold(sublime.Region(5, 15))
[]
>>> view.fold(sublime.Region(5, 15))
True
>>> view.fold(sublime.Region(5, 20))
True
>>> view.fold(sublime.Region(5, 32))
True
>>> view.unfold(sublime.Region(25, 30))
[Region(14, 46)]
For it to work, your plugin would have to keep track of which regions were folded and refold them back when sublime unfolded everything, but there is no event lister for the fold event for you to keep track of. You would need to add a custom gutter icon action to override the default fold button, but I wonder if you can add a custom gutter button for the user to click. Perhaps fold by a keybind and use the user selection, but there is no way to detect when the user hits the unfold button so your plugin can refold back. You could also use two key binds, one to fold and another to unfold under the selection, but it would be awkward to fold and unfold by selection and key binds.
Some related topics to gutter:
I've been using BufferScroll for years.
@willrowe Correct me if i'm wrong, but BufferScroll is designed to save the "folding state" of the code, so when we close the file and reopen it, the plugin will restore all folded regions.
That's not what this issue is about. We actually want to change the behavior of the fold/unfold commands, to use it WHILE CODING, not while closing and reopening files.
You can check Notepad++'s implementation of the fold/unfold functionality as a perfect example of what we want (the code unfolds step-by-step, instead of unfolding all children at once).
@AndrePssoa you are correct, I misunderstood the part about nesting. BufferScroll only remembers the top level.
Summary
Sublime Text cannot remember nested folding state.
Expected behavior
When unfolding the parent fold, it is expected to its children folds be remembered.
Actual behavior
When unfolding the parent fold, its children folds state are forgotten/lost.
Steps to reproduce
Create the text:
Environment
dpi_scale
used in ST 1.0