diff --git a/juci/notebook.cc b/juci/notebook.cc index 6a6d8d8..51a10ed 100644 --- a/juci/notebook.cc +++ b/juci/notebook.cc @@ -94,6 +94,8 @@ void Notebook::Controller::CreateKeybindings() { if(location.first.size()>0) { open_file(location.first); CurrentSourceView()->get_buffer()->place_cursor(CurrentSourceView()->get_buffer()->get_iter_at_offset(location.second)); + while(gtk_events_pending()) + gtk_main_iteration(); CurrentSourceView()->scroll_to(CurrentSourceView()->get_buffer()->get_insert(), 0.0, 1.0, 0.5); } } diff --git a/juci/source.cc b/juci/source.cc index c7f48f2..95056af 100644 --- a/juci/source.cc +++ b/juci/source.cc @@ -48,17 +48,7 @@ file_path(file_path), project_path(project_path) { } get_buffer()->place_cursor(get_buffer()->get_iter_at_offset(0)); - signal_size_allocate().connect([this](Gtk::Allocation& allocation){ - if(!after_user_input) - scroll_to(get_buffer()->get_insert(), 0.0, 1.0, 0.5); - }); - - signal_event().connect([this](GdkEvent* event){ - if(event->type==GDK_KEY_PRESS || event->type==GDK_BUTTON_PRESS || event->type==GDK_SCROLL) - after_user_input=true; - return false; - }); - + search_settings = gtk_source_search_settings_new(); gtk_source_search_settings_set_wrap_around(search_settings, true); search_context = gtk_source_search_context_new(get_source_buffer()->gobj(), search_settings); @@ -380,6 +370,7 @@ void Source::ClangViewParse::start_reparse() { clang_readable=false; delayed_reparse_connection.disconnect(); delayed_reparse_connection=Glib::signal_timeout().connect([this]() { + clang_readable=false; parse_thread_go=true; return false; }, 1000); diff --git a/juci/source.h b/juci/source.h index 1d98f69..c5d01b2 100644 --- a/juci/source.h +++ b/juci/source.h @@ -66,7 +66,6 @@ public: std::function()> get_declaration_location; std::function goto_method; - bool after_user_input=false; protected: bool on_key_press_event(GdkEventKey* key); private: