diff --git a/juci/source.cc b/juci/source.cc index d92b8a3..88b510a 100644 --- a/juci/source.cc +++ b/juci/source.cc @@ -905,7 +905,7 @@ Source::ClangViewAutocomplete(file_path, project_path) { similar_tokens_tag->property_weight()=Pango::WEIGHT_BOLD; get_buffer()->signal_changed().connect([this]() { - if(last_similar_tokens_tagged!="") { + if(!renaming && last_similar_tokens_tagged!="") { get_buffer()->remove_tag(similar_tokens_tag, get_buffer()->begin(), get_buffer()->end()); last_similar_tokens_tagged=""; } @@ -968,11 +968,13 @@ Source::ClangViewAutocomplete(file_path, project_path) { number++; } for(auto &mark: marks) { + renaming=true; get_buffer()->erase(mark.first->get_iter(), mark.second->get_iter()); get_buffer()->insert_with_tag(mark.first->get_iter(), text, similar_tokens_tag); get_buffer()->delete_mark(mark.first); get_buffer()->delete_mark(mark.second); } + renaming=false; } return number; }; diff --git a/juci/source.h b/juci/source.h index 1b1ea53..af7f347 100644 --- a/juci/source.h +++ b/juci/source.h @@ -159,6 +159,7 @@ public: Glib::RefPtr similar_tokens_tag; std::string last_similar_tokens_tagged; std::unique_ptr selection_dialog; + bool renaming=false; }; class ClangView : public ClangViewRefactor {