Browse Source

Hide tooktips and stop tag similar symbol cleanup. No longer activates tooltips or similar symbol tags on format style, undo, redo and paste

merge-requests/382/head
eidheim 8 years ago
parent
commit
a3bb0eaaa5
  1. 4
      src/source.cc
  2. 1
      src/source.h
  3. 5
      src/source_clang.cc
  4. 2
      src/source_clang.h
  5. 3
      src/source_language_protocol.cc
  6. 1
      src/source_language_protocol.h
  7. 4
      src/window.cc

4
src/source.cc

@ -380,6 +380,7 @@ bool Source::View::save() {
format_style(true); format_style(true);
else if(Config::get().source.format_style_on_save_if_style_file_found) else if(Config::get().source.format_style_on_save_if_style_file_found)
format_style(false); format_style(false);
hide_tooltips();
} }
std::ofstream output(file_path.string(), std::ofstream::binary); 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) if(update_status_diagnostics)
update_status_diagnostics(this); update_status_diagnostics(this);
} }
hide_tooltips();
}; };
} }
else if(is_bracket_language) { else if(is_bracket_language) {
@ -921,6 +921,7 @@ Source::View::~View() {
g_clear_object(&search_settings); g_clear_object(&search_settings);
delayed_tooltips_connection.disconnect(); delayed_tooltips_connection.disconnect();
delayed_tag_similar_symbols_connection.disconnect();
renderer_activate_connection.disconnect(); renderer_activate_connection.disconnect();
non_deleted_views.erase(this); non_deleted_views.erase(this);
@ -1156,6 +1157,7 @@ void Source::View::paste() {
void Source::View::hide_tooltips() { void Source::View::hide_tooltips() {
delayed_tooltips_connection.disconnect(); delayed_tooltips_connection.disconnect();
delayed_tag_similar_symbols_connection.disconnect();
type_tooltips.hide(); type_tooltips.hide();
diagnostic_tooltips.hide(); diagnostic_tooltips.hide();
} }

1
src/source.h

@ -103,6 +103,7 @@ namespace Source {
Tooltips diagnostic_tooltips; Tooltips diagnostic_tooltips;
Tooltips type_tooltips; Tooltips type_tooltips;
sigc::connection delayed_tooltips_connection; 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); } 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 add_diagnostic_tooltip(const Gtk::TextIter &start, const Gtk::TextIter &end, std::string spelling, bool error);
void clear_diagnostic_tooltips(); void clear_diagnostic_tooltips();

5
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<Gtk::TextBuffer::Mark>& mark){ get_buffer()->signal_mark_set().connect([this](const Gtk::TextBuffer::iterator& iterator, const Glib::RefPtr<Gtk::TextBuffer::Mark>& mark){
if(mark->get_name()=="insert") { if(mark->get_name()=="insert") {
delayed_tag_similar_identifiers_connection.disconnect(); delayed_tag_similar_symbols_connection.disconnect();
delayed_tag_similar_identifiers_connection=Glib::signal_timeout().connect([this]() { delayed_tag_similar_symbols_connection=Glib::signal_timeout().connect([this]() {
auto identifier=get_identifier(); auto identifier=get_identifier();
tag_similar_identifiers(identifier); tag_similar_identifiers(identifier);
return false; return false;
@ -1797,7 +1797,6 @@ void Source::ClangView::full_reparse() {
void Source::ClangView::async_delete() { void Source::ClangView::async_delete() {
delayed_show_arguments_connection.disconnect(); delayed_show_arguments_connection.disconnect();
delayed_tag_similar_identifiers_connection.disconnect();
views.erase(this); views.erase(this);
std::set<boost::filesystem::path> project_paths_in_use; std::set<boost::filesystem::path> project_paths_in_use;

2
src/source_clang.h

@ -85,8 +85,6 @@ namespace Source {
}; };
public: public:
ClangViewRefactor(const boost::filesystem::path &file_path, Glib::RefPtr<Gsv::Language> language); ClangViewRefactor(const boost::filesystem::path &file_path, Glib::RefPtr<Gsv::Language> language);
protected:
sigc::connection delayed_tag_similar_identifiers_connection;
private: private:
Identifier get_identifier(); Identifier get_identifier();
void wait_parsing(); void wait_parsing();

3
src/source_language_protocol.cc

@ -417,8 +417,6 @@ Source::LanguageProtocolView::LanguageProtocolView(const boost::filesystem::path
} }
Source::LanguageProtocolView::~LanguageProtocolView() { Source::LanguageProtocolView::~LanguageProtocolView() {
delayed_tag_similar_symbols_connection.disconnect();
if(initialize_thread.joinable()) if(initialize_thread.joinable())
initialize_thread.join(); initialize_thread.join();
@ -529,7 +527,6 @@ void Source::LanguageProtocolView::setup_navigation_and_refactoring() {
} }
get_buffer()->end_user_action(); get_buffer()->end_user_action();
} }
hide_tooltips();
}; };
} }

1
src/source_language_protocol.h

@ -114,7 +114,6 @@ namespace Source {
void unescape_text(std::string &text); void unescape_text(std::string &text);
Glib::RefPtr<Gtk::TextTag> similar_symbol_tag; Glib::RefPtr<Gtk::TextTag> similar_symbol_tag;
sigc::connection delayed_tag_similar_symbols_connection;
void tag_similar_symbols(); void tag_similar_symbols();
Offset get_declaration(const Gtk::TextIter &iter); Offset get_declaration(const Gtk::TextIter &iter);

4
src/window.cc

@ -391,6 +391,7 @@ void Window::set_menu_actions() {
view->disable_spellcheck=true; view->disable_spellcheck=true;
undo_manager->undo(); undo_manager->undo();
view->disable_spellcheck=false; view->disable_spellcheck=false;
view->hide_tooltips();
view->scroll_to(view->get_buffer()->get_insert()); view->scroll_to(view->get_buffer()->get_insert());
} }
} }
@ -402,6 +403,7 @@ void Window::set_menu_actions() {
view->disable_spellcheck=true; view->disable_spellcheck=true;
undo_manager->redo(); undo_manager->redo();
view->disable_spellcheck=false; view->disable_spellcheck=false;
view->hide_tooltips();
view->scroll_to(view->get_buffer()->get_insert()); view->scroll_to(view->get_buffer()->get_insert());
} }
} }
@ -479,6 +481,7 @@ void Window::set_menu_actions() {
source_view->disable_spellcheck=true; source_view->disable_spellcheck=true;
source_view->paste(); source_view->paste();
source_view->disable_spellcheck=false; source_view->disable_spellcheck=false;
source_view->hide_tooltips();
} }
else if(view->get_editable()) else if(view->get_editable())
view->get_buffer()->paste_clipboard(Gtk::Clipboard::get()); view->get_buffer()->paste_clipboard(Gtk::Clipboard::get());
@ -540,6 +543,7 @@ void Window::set_menu_actions() {
view->disable_spellcheck=true; view->disable_spellcheck=true;
view->format_style(true); view->format_style(true);
view->disable_spellcheck=false; view->disable_spellcheck=false;
view->hide_tooltips();
} }
}); });

Loading…
Cancel
Save