Also save after renaming

This commit is contained in:
Patrick Lipka 2021-12-17 15:48:57 +01:00
parent d3d68132d7
commit dde3e413da
1 changed files with 2 additions and 0 deletions

View File

@ -437,6 +437,7 @@ void command_re(std::string input, std::string new_name, ProjectList *proj_list)
std::string old_name = proj_list->projects[id].name; std::string old_name = proj_list->projects[id].name;
proj->name = underscore_to_space(new_name); proj->name = underscore_to_space(new_name);
std::cout << "Renamed project " << old_name << " to " << proj->name << std::endl; std::cout << "Renamed project " << old_name << " to " << proj->name << std::endl;
command_save(proj_list);
}else{ }else{
int task_id = proj_list->active_project->find_task_id_by_name(trim(underscore_to_space(task_name))); int task_id = proj_list->active_project->find_task_id_by_name(trim(underscore_to_space(task_name)));
if (task_id >=0){ if (task_id >=0){
@ -450,6 +451,7 @@ void command_re(std::string input, std::string new_name, ProjectList *proj_list)
autocomplete_names.push_back(space_to_underscore(proj->name)+"/"+space_to_underscore(new_name)); autocomplete_names.push_back(space_to_underscore(proj->name)+"/"+space_to_underscore(new_name));
} }
std::cout << "Renamed task " << underscore_to_space(proj->name) << "/" << underscore_to_space(task_name) << " to " << underscore_to_space(proj->name) << "/" << underscore_to_space(new_name) << std::endl; std::cout << "Renamed task " << underscore_to_space(proj->name) << "/" << underscore_to_space(task_name) << " to " << underscore_to_space(proj->name) << "/" << underscore_to_space(new_name) << std::endl;
command_save(proj_list);
}else{ }else{
std::cout << "Task " << underscore_to_space(proj->name) << "/" << underscore_to_space(task_name) << " does not exist." << std::endl; std::cout << "Task " << underscore_to_space(proj->name) << "/" << underscore_to_space(task_name) << " does not exist." << std::endl;
} }