setting for auto-loading of recent projects

This commit is contained in:
Ryan Fleury
2026-06-02 12:11:17 -07:00
parent 1673fa5606
commit 5a819f8094
3 changed files with 17 additions and 1 deletions
File diff suppressed because one or more lines are too long
+4
View File
@@ -312,6 +312,10 @@ RD_VocabTable:
//- rjf: transient tabs
@default(1) @display_name('Transient Tabs') @description("When snapping to source code locations, opens new files in a 'transient' tab if they are not already open. Transient tabs are replaced on subsequent snaps automatically.")
'transient_tabs': bool,
//- rjf: auto-load last project
@default(0) @display_name('Auto Load Last Project') @description("Enables loading the most recently opened project when a user file is loaded (and thus when the debugger starts).")
'auto_load_last_project': bool,
}
```
}
+12
View File
@@ -13128,6 +13128,18 @@ rd_frame(void)
rd_cmd(RD_CmdKind_SetCurrentPath, .file_path = new_current_dir);
}
}
//- rjf: if just opened user -> load last project, if enabled
if(kind == RD_CmdKind_OpenUser && rd_setting_b32_from_name(s("auto_load_last_project")))
{
CFG_Node *user = cfg_node_child_from_string(cfg_node_root(), s("user"));
CFG_NodePtrList recent_projects = cfg_node_child_list_from_string(scratch.arena, user, s("recent_project"));
CFG_Node *recent_project = cfg_node_ptr_list_first(&recent_projects);
if(recent_project != &cfg_nil_node)
{
rd_cmd(RD_CmdKind_OpenRecentProject, .cfg = recent_project->id);
}
}
}break;
case RD_CmdKind_NewUser:
{