diff --git a/src/files.h b/src/files.h index 8f49573..2c5d92f 100644 --- a/src/files.h +++ b/src/files.h @@ -70,7 +70,7 @@ const std::string configjson = " \"source_spellcheck_clear\": \"\",\n" " \"source_spellcheck_next_error\": \"e\",\n" " \"source_indentation_set_buffer_tab\": \"\",\n" -" \"source_indentation_auto_indent_buffer\": \"\",\n" +" \"source_indentation_auto_indent_buffer\": \"i\",\n" " \"source_goto_line\": \"g\",\n" " \"source_center_cursor\": \"l\",\n" " \"source_goto_declaration\": \"d\",\n" diff --git a/src/window.cc b/src/window.cc index 142a8c1..cd7a302 100644 --- a/src/window.cc +++ b/src/window.cc @@ -200,14 +200,13 @@ void Window::create_menu() { } else Singleton::terminal()->print("Error: "+path.string()+" already exists.\n"); + Singleton::directories()->select(path); } - Singleton::directories()->select(path); }); menu.action_group->add(Gtk::Action::create("FileNewProject", "New Project")); menu.action_group->add(Gtk::Action::create("FileNewProjectCpp", "C++"), [this]() { - boost::filesystem::path project_path = Dialog::new_folder(); - if(project_path=="") - return; + boost::filesystem::path project_path = Dialog::new_folder(); + if(project_path!="") { auto project_name=project_path.filename().string(); for(size_t c=0;cprint("Error: Could not create project "+project_path.string()+"\n"); + } }); menu.action_group->add(Gtk::Action::create("FileOpenFile", "Open File"), Gtk::AccelKey(menu.key_map["open_file"]), [this]() { - notebook.open(Dialog::select_file()); + auto path=Dialog::select_file(); + if(path!="") + notebook.open(path); }); menu.action_group->add(Gtk::Action::create("FileOpenFolder", "Open Folder"), Gtk::AccelKey(menu.key_map["open_folder"]), [this]() { auto path = Dialog::select_folder();