feat: add project save/load with .wheel files and auto-save thread
Co-authored-by: aider (deepseek/deepseek-coder) <aider@aider.chat>
This commit is contained in:
21
tui.c
21
tui.c
@@ -745,10 +745,23 @@ static bool handle_command_mode(void) {
|
||||
}
|
||||
}
|
||||
} else if (strncmp(cmd_buffer, "save ", 5) == 0) {
|
||||
int clip_idx = atoi(cmd_buffer + 5);
|
||||
Action action = { .type = ACTION_SAVE_CLIP, .data.save_clip = { .clip_index = clip_idx } };
|
||||
g_dispatch(action);
|
||||
}
|
||||
const char *filename = cmd_buffer + 5;
|
||||
while (*filename == ' ') filename++;
|
||||
if (*filename) {
|
||||
Action action = { .type = ACTION_SAVE_PROJECT };
|
||||
strncpy(action.data.save_project.filename, filename, sizeof(action.data.save_project.filename) - 1);
|
||||
action.data.save_project.filename[sizeof(action.data.save_project.filename) - 1] = '\0';
|
||||
g_dispatch(action);
|
||||
}
|
||||
} else if (strncmp(cmd_buffer, "load ", 5) == 0) {
|
||||
const char *filename = cmd_buffer + 5;
|
||||
while (*filename == ' ') filename++;
|
||||
if (*filename) {
|
||||
Action action = { .type = ACTION_LOAD_PROJECT };
|
||||
strncpy(action.data.load_project.filename, filename, sizeof(action.data.load_project.filename) - 1);
|
||||
action.data.load_project.filename[sizeof(action.data.load_project.filename) - 1] = '\0';
|
||||
g_dispatch(action);
|
||||
}
|
||||
|
||||
nodelay(stdscr, prev_nodelay);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user