(ctx: &mut ScriptContext<'_, API>, idx: usize)
| 216 | set_project_manager(ctx, true); |
| 217 | } |
| 218 | } |
| 219 | Err(err) => { |
| 220 | set_log( |
| 221 | ctx, |
| 222 | &format!("create project fail\n{parent}\n{name}\n{err}"), |
| 223 | ); |
| 224 | refresh_all(ctx); |
| 225 | } |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | pub fn open_recent_project<API: ScriptAPI + ?Sized>(ctx: &mut ScriptContext<'_, API>, idx: usize) { |
| 230 | let path = with_state!(ctx.run, EditorState, ctx.id, |state| { |
| 231 | state.recent_projects.get(idx).cloned() |
| 232 | }).unwrap_or_default(); |
| 233 | let Some(path) = path else { |
nothing calls this directly
no test coverage detected