Alexander-Miller / treemacs

GNU General Public License v3.0
2.12k stars 156 forks source link

Order workspaces according to `treemacs-persist` #1108

Closed sebastiaanspeck closed 3 months ago

sebastiaanspeck commented 6 months ago

I would love to see that treemacs respects the order of my workspaces that are being listed in the treemacs-persist file. Right now if I want to switch to another workspace, the order seems random to me.

stale[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had recent activity (this bot only works as a reminder, it will not close issues).

sebastiaanspeck commented 4 months ago

There was no reaction till now, so please do not mark as stale

Alexander-Miller commented 3 months ago

This ticket made me go on a deep dive about sort order for completing-read. Treemacs does keep its workspaces in the order it encounters them in the persist file, you can look at treemacs--workspaces yourself.

However the order that Emacs shows you in completing-read depends on collection metadata that you can pass on as well. Selection packages also have their own settings, like vertico-sort-function for my own config.

I should be able to use the first method to enforce that order - at least in this workspace selection, so let me know if it should be applied elsewhere as well.

Alexander-Miller commented 3 months ago

Change is pushed now, let me know if anything is missing.

sebastiaanspeck commented 3 months ago

Change is pushed now, let me know if anything is missing.

It works great! Thank you for fixing this minor issue