From 52adf1c07d6d35aaab91649b9ce2b927690e28d7 Mon Sep 17 00:00:00 2001 From: Ole Christian Eidheim Date: Thu, 27 Aug 2015 12:32:32 +0200 Subject: [PATCH] Now doing a soft reparse every time a clangview-page gets focused (in case a header file for instance is changed) --- src/source.h | 2 +- src/window.cc | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/source.h b/src/source.h index e51ff3d..f71d3ee 100644 --- a/src/source.h +++ b/src/source.h @@ -102,9 +102,9 @@ namespace Source { public: ClangViewParse(const boost::filesystem::path &file_path, const boost::filesystem::path& project_path); boost::filesystem::path project_path; + void start_reparse(); protected: void init_parse(); - void start_reparse(); bool on_key_press_event(GdkEventKey* key); bool on_focus_out_event(GdkEventFocus* event); std::unique_ptr clang_tu; diff --git a/src/window.cc b/src/window.cc index bba2e52..75c528a 100644 --- a/src/window.cc +++ b/src/window.cc @@ -93,6 +93,9 @@ Window::Window() : box(Gtk::ORIENTATION_VERTICAL), notebook(directories), compil directories.select(notebook.get_current_view()->file_path); + if(auto source_view=dynamic_cast(notebook.get_current_view())) + source_view->start_reparse(); + Singleton::status()->set_text(notebook.get_current_view()->status); } });