From 9d384774e69acbd5b3e74d5a7bf8653c6be5922a Mon Sep 17 00:00:00 2001 From: eidheim Date: Thu, 8 Oct 2015 13:54:37 +0200 Subject: [PATCH] Now adding project_path if possible to all file types. --- src/notebook.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/notebook.cc b/src/notebook.cc index 2987538..b255cfe 100644 --- a/src/notebook.cc +++ b/src/notebook.cc @@ -88,8 +88,12 @@ void Notebook::open(const boost::filesystem::path &file_path) { } source_views.emplace_back(new Source::ClangView(file_path, project_path, language)); } - else - source_views.emplace_back(new Source::GenericView(file_path, "", language)); + else { + boost::filesystem::path project_path; + if(directories.cmake && directories.cmake->project_path!="" && file_path.generic_string().substr(0, directories.cmake->project_path.generic_string().size()+1)==directories.cmake->project_path.generic_string()+'/') + project_path=directories.cmake->project_path; + source_views.emplace_back(new Source::GenericView(file_path, project_path, language)); + } source_views.back()->on_update_status=[this](Source::View* view, const std::string &status) { if(get_current_page()!=-1 && get_current_view()==view)