I use the "File / Open recent" menu far more than "sessions" or "projects." Maybe I'm confused how CudaText works, but I ask anyway.
The only tweak for recent files is to clear the list. I want to change it. I want different groups swapping in and out. Only one group is active at a time. I don't want files in the active group opened, just listed. The purpose of a recent files group is to offer a list of files for opening, just as "Open recent" does. A group does not need lexers, bookmarks, cursors, or other metadata. I just want a hackable recent files list.
Now I may need a 'jq' or 'jaq' script to swap out the json stanza in history.json. If I can achieve the trick with any existing CudaText method (projects, sessions, custom menus, whatever), please let me know.
Thanks!
Hackable Recent Files
-
- Posts: 2376
- Joined: 25.08.2021 18:15
Re: Hackable Recent Files
maybe it will be OK to give the python API to read/write names of recent filenames? then you can make a plugin.
-
- Posts: 52
- Joined: 13.07.2024 21:19
Re: Hackable Recent Files
Maybe. It might also work to add boolean options to each separate project or session controlling what files automatically open when it's active ( 0 = none, 1 = all ).
-
- Posts: 2376
- Joined: 25.08.2021 18:15
Re: Hackable Recent Files
Boolean options? add them where, to session? but it's redundant. when user opens a session, session's last opened filenames are opened in Cud. no need for option.
I added the API:
1.0.463 (1.221.6)
* add: app_proc: PROC_SET_FILE_RECENTS
PROC_SET_FILE_RECENTS: Fills "recent filenames" list. Param "text" must be string, "\n"-separated filenames. First filename will be in the bottom of recents, last one will be in the top.
sorry that "text" is not usual list, it was hard to handle usual list.
I added the API:
1.0.463 (1.221.6)
* add: app_proc: PROC_SET_FILE_RECENTS
PROC_SET_FILE_RECENTS: Fills "recent filenames" list. Param "text" must be string, "\n"-separated filenames. First filename will be in the bottom of recents, last one will be in the top.
sorry that "text" is not usual list, it was hard to handle usual list.
-
- Posts: 52
- Joined: 13.07.2024 21:19
Re: Hackable Recent Files
The boolean defines if the session or project opens its files automatically. Consider the 'Open recent' item on the 'File' menu. 'Open recent' just shows a list, it does not open the whole list at once. A session or project does open all its files at once.main Alexey wrote: ↑28.02.2025 16:17 Boolean options? add them where, to session? but it's redundant. when user opens a session, session's last opened filenames are opened in Cud. no need for option.
I will experiment with the new API. Thanks!
-
- Posts: 2376
- Joined: 25.08.2021 18:15
Re: Hackable Recent Files
Session opens all its files. yes. it is ok. project does not. it opens only files opened in its 'project session' (if it exists in project).