Browse Source

Now doing a soft reparse every time a clangview-page gets focused (in case a header file for instance is changed)

merge-requests/365/head
Ole Christian Eidheim 10 years ago
parent
commit
52adf1c07d
  1. 2
      src/source.h
  2. 3
      src/window.cc

2
src/source.h

@ -102,9 +102,9 @@ namespace Source {
public: public:
ClangViewParse(const boost::filesystem::path &file_path, const boost::filesystem::path& project_path); ClangViewParse(const boost::filesystem::path &file_path, const boost::filesystem::path& project_path);
boost::filesystem::path project_path; boost::filesystem::path project_path;
void start_reparse();
protected: protected:
void init_parse(); void init_parse();
void start_reparse();
bool on_key_press_event(GdkEventKey* key); bool on_key_press_event(GdkEventKey* key);
bool on_focus_out_event(GdkEventFocus* event); bool on_focus_out_event(GdkEventFocus* event);
std::unique_ptr<clang::TranslationUnit> clang_tu; std::unique_ptr<clang::TranslationUnit> clang_tu;

3
src/window.cc

@ -93,6 +93,9 @@ Window::Window() : box(Gtk::ORIENTATION_VERTICAL), notebook(directories), compil
directories.select(notebook.get_current_view()->file_path); directories.select(notebook.get_current_view()->file_path);
if(auto source_view=dynamic_cast<Source::ClangView*>(notebook.get_current_view()))
source_view->start_reparse();
Singleton::status()->set_text(notebook.get_current_view()->status); Singleton::status()->set_text(notebook.get_current_view()->status);
} }
}); });

Loading…
Cancel
Save