diff --git a/juci/selectiondialog.h b/juci/selectiondialog.h index 7afad0e..d55d9a3 100644 --- a/juci/selectiondialog.h +++ b/juci/selectiondialog.h @@ -14,7 +14,7 @@ public: virtual void hide(); virtual void move(); - std::map > rows; //TODO: remove, instead add on_select + std::map > rows; //TODO: remove, instead add on_select. Also remember to destroy start_mark in destructor std::function on_hide; bool shown=false; Glib::RefPtr start_mark; diff --git a/juci/source.cc b/juci/source.cc index 17c4937..d2c7804 100644 --- a/juci/source.cc +++ b/juci/source.cc @@ -814,7 +814,10 @@ Source::ClangViewAutocomplete(file_path, project_path), selection_dialog(*this) selection_dialog.start_mark=get_buffer()->create_mark(get_buffer()->get_insert()->get_iter()); std::map > rows; selection_dialog.init(); - for(auto &method: clang_tokens->get_cxx_methods()) { + auto methods=clang_tokens->get_cxx_methods(); + if(methods.size()==0) + return; + for(auto &method: methods) { rows[method.first]=std::pair(std::to_string(method.second), ""); selection_dialog.append(method.first); }