sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
801 stars 36 forks source link

Sidebar Sort Options #328

Open anatomatic opened 10 years ago

anatomatic commented 10 years ago

Sorting files in the sidebar by date (ascending / descending) would be fantastic. Even more advanced, sort folders in the sidebar independently of each other.

I understand that there isn't a Sidebar API, so this would either need to be a core feature, or a plugin if a Sidebar API were to be released.

juanmiguel431 commented 8 years ago

I would like the way to sort files like windows.

image

keith-hall commented 8 years ago

@juanmiguel431 for reference, this is called natural sort order - https://blog.codinghorror.com/sorting-for-humans-natural-sort-order/

Klortho commented 7 years ago

Another option that would be nice (see also #721 ):

stevenvachon commented 7 years ago

Do it.

benwolman commented 7 years ago

I'd love to see sorting by file type.

awmottaz commented 7 years ago

I would also like the alphabetical sorting to be case-insensitive. It appears that it orders alphabetically by ASCII code.

KiboOst commented 7 years ago

Yes, sorting file by type would amazing!

GospelNerd commented 7 years ago

+1 for sorting by filetype

randy3k commented 7 years ago

on Mac, the default sorting is case insensitive. I would be nice to have an option to sort files case sensitively.

roamn commented 7 years ago

Years passed ...

screenshot_3

vishalp36 commented 7 years ago

Yes, sorting file by type would amazing!

titoBouzout commented 6 years ago

I believe the best approach to fix this is to make the sorting function public so anyone sort the files as they wish by just defining a function. It would be nice to have a menu above the sidebar or on bottom listing as menuitems all the available sorting functions defined (by date, by type, by name, etc [as defined by the custom function(s) description])

tobirothschild-gugg commented 6 years ago

I would love to be able to sort by last modified date. When dealing with tons of files this is the easiest way to find what you are working on.

jdhao commented 6 years ago

@tobirothschild-gugg , +1 for sorting the files according to last modified date.

eliemassaad commented 6 years ago

+1 for sorting functionality

zzh8829 commented 6 years ago

+1 for customized sorting

zhouyisu commented 6 years ago

+1 would definitely love to have the sorting functionality

wavemode commented 5 years ago

+1 I would pay money for this feature (kidding, sort of)

achamess commented 5 years ago

+1. This seems like a common and reasonable request.

kanlukasz commented 5 years ago

still nothing?

ron-wolf commented 5 years ago

@FichteFoll @titoBouzout @keith-hall Could you guys provide some information on whether or not this feature is in the works? I’m unsure exactly who to ask about this.

titoBouzout commented 5 years ago

We dont know. The features that are being worked appear in the change log for the dev builds. https://www.sublimetext.com/3dev

mkanet commented 5 years ago

I've waited several years for a real sidebar and basic sidebar options going back to ST2. This issue may end up being what ultimately pushes me to switch to VSCode. VSCode doesn't look as nice or as fast as ST3.. but at least it's more functional.

oceanpix commented 5 years ago

A better sorting in the sidebar would be a nice feature to have. It's pretty odd to navigate trough versions without a natural order arrangement

Capture

IMP1 commented 4 years ago

It would be really nice to have an option to customise the ordering of the files + directories. I'd personally like to have any file named index.html to be listed first in the folder for some projects.

titoBouzout commented 4 years ago

https://github.com/SublimeTextIssues/Core/issues/328#issuecomment-329565745

patakk commented 4 years ago

Apparently this is such an irrelevant issue that it remains ignored even after all these years and years. The @titoBouzout's suggestion sounds great, but I guess we'll never see it realized..

VSCode it is..

wbond commented 4 years ago

I'd personally like to have any file named index.html to be listed first in the folder for some projects.

How would you foresee something like this working?

wbond commented 4 years ago

Apparently this is such an irrelevant issue that it remains ignored even after all these years and years.

It has been low priority because it would require some significant rewrites of how our internal data structure for files and folders stores and sorts data.

Additionally, in the grand scheme of things it doesn't seem like such a major issue compared to other things we could be working on. I guess for some people being able to change the sort order is enough to change their whole development environment.

IMP1 commented 4 years ago

I'd personally like to have any file named index.html to be listed first in the folder for some projects.

How would you foresee something like this working?

If it were possible to pass a lambda to the sorting function, then it would be pretty simple to do something like this.

IMP1 commented 4 years ago

Additionally, in the grand scheme of things it doesn't seem like such a major issue compared to other things we could be working on. I guess for some people being able to change the sort order is enough to change their whole development environment.

I love Sublime too much to switch to anything else. This would just be nice to have. But if it's too much effort maybe close this as a wontfix or something?

wbond commented 4 years ago

If it were possible to pass a lambda to the sorting function, then it would be pretty simple to do something like this.

That would probably not be doable since the lambda would have to be written in Python and thus would need to round-trip the SHM process channel from the main editor to the plugin_host for every comparison in the sort. That involves serializing the data to be compared (allocating a string) sending it, deserializing, converting to Python, executing the Python function and then sending the result back.

It would be wicked slow. :-)

wbond commented 4 years ago

I love Sublime too much to switch to anything else. This would just be nice to have. But if it's too much effort maybe close this as a wontfix or something?

Well, I don't think it is a won't fix. I personally would prefer the sorting using natural case at the very least. It just is low priority compared to other things so far. If we closed every old issue, we'd miss out on lots of the fixes and improvements we had in 3, 3.1 and 3.2.

patakk commented 4 years ago

Additionally, in the grand scheme of things it doesn't seem like such a major issue compared to other things we could be working on. I guess for some people being able to change the sort order is enough to change their whole development environment.

Eh, I won't actually change it, it was a threat hoping it'll push things in the right direction :P

Anyway, I get it, but this is honestly the first time I've read a developer's response to this issue, which is an improvement I guess. But it seems rather weird that (seemingly) such a simple functionality would result in such an effort.

rwols commented 4 years ago

But it seems rather weird that (seemingly) such a simple functionality would result in such an effort.

Sorting files according to what we humans expect is rather non-trivial: https://blog.codinghorror.com/sorting-for-humans-natural-sort-order/

titoBouzout commented 4 years ago

There's no doubt that "sorting" is not trivial, in a human/culture/language/semantic scope, just let the regular sorting be.

AND and IF the user wants to define a "sorting" function, then just use that, if its slow then is not your business/problem any more, we want to sort. We dont care what ST developers think of our custom sorting functions.

You just default to your blazing fast sorting if no user defined sorting was found...... so you dont lose anything, you just give us something.....

titoBouzout commented 4 years ago

In summary for the complete SublimeText software, give us the APIs, do not think of me, I dont care/never asked what you think. Just give us the APIs. The APIs give us freedom, I can think for myself and others do too. :) get wiser, you have a great editor, you add features, you should add(and fix man) the apis! -__-

titoBouzout commented 4 years ago

Is not up to you to decide if its slow or not. People just asked here to group by file type, by file name, natural sorting, show index.html first. Well yeah I feel them, we all have different preferences, I name my stuff like "@TODO" so just the stupid sorting thing shows it on top or bottom. Just make the function public..... you wont be able never to make everyone happy. We talked enough here..... Theres too many comments. Its obvious what the resolution is.... is not as if yours or us sorting function needs to run a million of times per second, it only runs when you expand/new file/folder on how many times? fine, lets say 1000.... who has 1000 items in a directory? not to many..... how slow can be, and why do you even care?..... we wrote it after all....

titoBouzout commented 4 years ago

I locked this issue because the conversation is useless, is obvious what to do. Just go ahead and +1 what you like.

wbond commented 4 years ago

is not as if yours or us sorting function needs to run a million of times per second, it only runs when you expand/new file/folder on how many times

No, it is invoked any time a file notification is received from the OS. We have to sort and find where the file is located in our in-memory tree. Beyond that, we actually do get bug reports from users having tens of thousands of files in directories complaining when things aren't fast.

fine, lets say 1000.... who has 1000 items in a directory? not to many..... how slow can be

Depending on how it is written in Python, really slow. I would not want the CPU taking 1s to decided where in the tree to store a file that was just created.

why do you even care?..... we wrote it after all....

Ultimately the users blame ST when there is poor performance, since it isn't easy to know that a customization is causing the issue.

I locked this issue because the conversation is useless, is obvious what to do.

I am answering questions from users. I don't think it is heated at all, just explaining the sort of decisions we have to consider in order to keep Sublime Text fast, and why sometimes trivial looking things aren't implemented right away.

titoBouzout commented 4 years ago

Well you are wrong, you are deciding for the users, you can just add custom sorting while at the same time keeping stable (blazing fast ST TM sorting). But you dont want which is ok. Fine. Nothing else to talk I guess.

wbond commented 4 years ago

@titoBouzout Please stop locking the issue, you are being actively hostile to the community

evandrocoan commented 4 years ago

Just go ahead and +1 what you like.

@titoBouzout, if the post is locked, no one can +1 (up vote comments) and any reference to this issue would not show up here, unless one of the developers referenced it or up voted it.

Although, if Python is not a performance viable API, then, a C++ API come to rescue: (Add a C++ API for critical/time sensitive code #3095)

patakk commented 4 years ago

But it seems rather weird that (seemingly) such a simple functionality would result in such an effort.

Sorting files according to what we humans expect is rather non-trivial: https://blog.codinghorror.com/sorting-for-humans-natural-sort-order/

While you're correct, that is irrelevant and not the root cause of the problem. The reason this will take more than 5 years is not the complexity of the sorting algorithm(s), but rather the complexity of any file reordering (independent of the algorithm) since it would apparently require a lot of code rewrite and dealing with the file tree structure.

Which is pretty strange to me. Is it that difficult to separate the memory structure of the files from the front-end that displays it in the sideview?

rwols commented 4 years ago

While you're correct, that is irrelevant and not the root cause of the problem.

True. I also now see that Keith Hall has posted the same link about three years earlier.

John-Dean commented 4 years ago

Is there a chance for this to get added in ST4?

vizvamitra commented 2 years ago

Here is a usecase for descending order:

Rails (a web framework written in Ruby) uses database migrations to incrementally migrate DB schema. All migrations are stored inthe same folder (db/migrate). There is a naming convention for database migration files: the format is YYYYMMDDHHMMSS_migration_name.rb (example: 20211209154612_create_users.rb) which makes them sorted in a chronological order. Old projects may have a ton of migrations (ours has 513) but you are usually interested in only the most recent ones. So if you don't know the name / the date to Ctrl+P to the one you're interested in you need to scroll down through all those hundreds of files.

Would be great to be able to set sorting order either from a right-click menu of the folder or in a .sublime_project file

jtesch commented 2 years ago

Bro it's been 8 years just add it already lmao

Gerst20051 commented 2 years ago

I've also been thinking about this for a while. Perhaps it is worth creating a new standard that defines how to sort a directory.

I've compiled a few filename ideas:

Any ideas on what the contents of this file would be and what all of the different sorting methods are?

The main ones would be:

The secondary ones would be:

References:

https://www.softwaretestinghelp.com/unix-sort-command/

vizvamitra commented 2 years ago

I also see another option, at least for my usecase: a "scroll to top/bottom of the expanded folder" buttons, shown only when the content of the expanded folder doesn't fit into screen. Yet this may be much harder to implement