From a3bb0eaaa525ea36bda4f344db6a9c0efc979bfa Mon Sep 17 00:00:00 2001 From: eidheim Date: Tue, 15 May 2018 08:34:26 +0200 Subject: [PATCH] Hide tooktips and stop tag similar symbol cleanup. No longer activates tooltips or similar symbol tags on format style, undo, redo and paste --- src/source.cc | 4 +++- src/source.h | 1 + src/source_clang.cc | 5 ++--- src/source_clang.h | 2 -- src/source_language_protocol.cc | 3 --- src/source_language_protocol.h | 1 - src/window.cc | 4 ++++ 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/source.cc b/src/source.cc index 53203a1..9b770af 100644 --- a/src/source.cc +++ b/src/source.cc @@ -380,6 +380,7 @@ bool Source::View::save() { format_style(true); else if(Config::get().source.format_style_on_save_if_style_file_found) format_style(false); + hide_tooltips(); } std::ofstream output(file_path.string(), std::ofstream::binary); @@ -665,7 +666,6 @@ void Source::View::setup_format_style(bool is_generic_view) { if(update_status_diagnostics) update_status_diagnostics(this); } - hide_tooltips(); }; } else if(is_bracket_language) { @@ -921,6 +921,7 @@ Source::View::~View() { g_clear_object(&search_settings); delayed_tooltips_connection.disconnect(); + delayed_tag_similar_symbols_connection.disconnect(); renderer_activate_connection.disconnect(); non_deleted_views.erase(this); @@ -1156,6 +1157,7 @@ void Source::View::paste() { void Source::View::hide_tooltips() { delayed_tooltips_connection.disconnect(); + delayed_tag_similar_symbols_connection.disconnect(); type_tooltips.hide(); diagnostic_tooltips.hide(); } diff --git a/src/source.h b/src/source.h index 9e7b405..10b5153 100644 --- a/src/source.h +++ b/src/source.h @@ -103,6 +103,7 @@ namespace Source { Tooltips diagnostic_tooltips; Tooltips type_tooltips; sigc::connection delayed_tooltips_connection; + sigc::connection delayed_tag_similar_symbols_connection; virtual void show_diagnostic_tooltips(const Gdk::Rectangle &rectangle) { diagnostic_tooltips.show(rectangle); } void add_diagnostic_tooltip(const Gtk::TextIter &start, const Gtk::TextIter &end, std::string spelling, bool error); void clear_diagnostic_tooltips(); diff --git a/src/source_clang.cc b/src/source_clang.cc index afd6076..affe581 100644 --- a/src/source_clang.cc +++ b/src/source_clang.cc @@ -970,8 +970,8 @@ Source::ClangViewRefactor::ClangViewRefactor(const boost::filesystem::path &file get_buffer()->signal_mark_set().connect([this](const Gtk::TextBuffer::iterator& iterator, const Glib::RefPtr& mark){ if(mark->get_name()=="insert") { - delayed_tag_similar_identifiers_connection.disconnect(); - delayed_tag_similar_identifiers_connection=Glib::signal_timeout().connect([this]() { + delayed_tag_similar_symbols_connection.disconnect(); + delayed_tag_similar_symbols_connection=Glib::signal_timeout().connect([this]() { auto identifier=get_identifier(); tag_similar_identifiers(identifier); return false; @@ -1797,7 +1797,6 @@ void Source::ClangView::full_reparse() { void Source::ClangView::async_delete() { delayed_show_arguments_connection.disconnect(); - delayed_tag_similar_identifiers_connection.disconnect(); views.erase(this); std::set project_paths_in_use; diff --git a/src/source_clang.h b/src/source_clang.h index 59a3e0d..76aeef8 100644 --- a/src/source_clang.h +++ b/src/source_clang.h @@ -85,8 +85,6 @@ namespace Source { }; public: ClangViewRefactor(const boost::filesystem::path &file_path, Glib::RefPtr language); - protected: - sigc::connection delayed_tag_similar_identifiers_connection; private: Identifier get_identifier(); void wait_parsing(); diff --git a/src/source_language_protocol.cc b/src/source_language_protocol.cc index 219f038..d95a068 100644 --- a/src/source_language_protocol.cc +++ b/src/source_language_protocol.cc @@ -417,8 +417,6 @@ Source::LanguageProtocolView::LanguageProtocolView(const boost::filesystem::path } Source::LanguageProtocolView::~LanguageProtocolView() { - delayed_tag_similar_symbols_connection.disconnect(); - if(initialize_thread.joinable()) initialize_thread.join(); @@ -529,7 +527,6 @@ void Source::LanguageProtocolView::setup_navigation_and_refactoring() { } get_buffer()->end_user_action(); } - hide_tooltips(); }; } diff --git a/src/source_language_protocol.h b/src/source_language_protocol.h index 3bb0924..967c6fc 100644 --- a/src/source_language_protocol.h +++ b/src/source_language_protocol.h @@ -114,7 +114,6 @@ namespace Source { void unescape_text(std::string &text); Glib::RefPtr similar_symbol_tag; - sigc::connection delayed_tag_similar_symbols_connection; void tag_similar_symbols(); Offset get_declaration(const Gtk::TextIter &iter); diff --git a/src/window.cc b/src/window.cc index ed94901..e9f3311 100644 --- a/src/window.cc +++ b/src/window.cc @@ -391,6 +391,7 @@ void Window::set_menu_actions() { view->disable_spellcheck=true; undo_manager->undo(); view->disable_spellcheck=false; + view->hide_tooltips(); view->scroll_to(view->get_buffer()->get_insert()); } } @@ -402,6 +403,7 @@ void Window::set_menu_actions() { view->disable_spellcheck=true; undo_manager->redo(); view->disable_spellcheck=false; + view->hide_tooltips(); view->scroll_to(view->get_buffer()->get_insert()); } } @@ -479,6 +481,7 @@ void Window::set_menu_actions() { source_view->disable_spellcheck=true; source_view->paste(); source_view->disable_spellcheck=false; + source_view->hide_tooltips(); } else if(view->get_editable()) view->get_buffer()->paste_clipboard(Gtk::Clipboard::get()); @@ -540,6 +543,7 @@ void Window::set_menu_actions() { view->disable_spellcheck=true; view->format_style(true); view->disable_spellcheck=false; + view->hide_tooltips(); } });