Sublime Forum

Where does sublime store recent files and folders names

#1

I want to make the list located in File > Open Recent accessible from the command palette, but I don’t know how to get the names of files and folders to show them as captions.

0 Likes

#2

I think that information is only available in the session file, and that’s only written when Sublime is closing. If that’s the case then that information would always be from the previous session.

You may be able to gather that information by a combination of introspecting the session file and tracking files as they’re closed in the current window though, by using on_pre_close to grab the names.

I would imagine that File History does something like that in order track this.

Note however that sublime-commands files require a caption, so to have these in the command palette you would need to keep recreating the file as the history changes. The items in the menu rely on the ability of commands to set their own caption dynamically.

0 Likes