From 4a6d92c893e7651e3e9014fc69974a90561e9b2f Mon Sep 17 00:00:00 2001 From: eidheim Date: Sun, 20 Dec 2015 08:28:08 +0100 Subject: [PATCH] cmake error messages no longer appear twice when saving CMakeLists.txt --- src/notebook.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/notebook.cc b/src/notebook.cc index 0308bc3..f42f022 100644 --- a/src/notebook.cc +++ b/src/notebook.cc @@ -248,14 +248,14 @@ bool Notebook::save(int page) { boost::filesystem::path project_path; if(view->file_path.filename()=="CMakeLists.txt") { auto &directories=Directories::get(); - if(directories.cmake && directories.cmake->project_path!="" && view->file_path.generic_string().substr(0, directories.cmake->project_path.generic_string().size()+1)==directories.cmake->project_path.generic_string()+'/' && CMake::create_compile_commands(directories.cmake->project_path)) { - project_path=directories.cmake->project_path; + if(directories.cmake && directories.cmake->project_path!="" && view->file_path.generic_string().substr(0, directories.cmake->project_path.generic_string().size()+1)==directories.cmake->project_path.generic_string()+'/') { + if(CMake::create_compile_commands(directories.cmake->project_path)) + project_path=directories.cmake->project_path; } else { CMake cmake(view->file_path.parent_path()); - if(cmake.project_path!="" && CMake::create_compile_commands(cmake.project_path)) { + if(cmake.project_path!="" && CMake::create_compile_commands(cmake.project_path)) project_path=cmake.project_path; - } } if(project_path!="") { for(auto source_view: source_views) {