allow StringCompletion to match anywhere

This commit is contained in:
Paul Davis
2025-06-08 09:14:04 -06:00
parent 23c7d564e2
commit 4eb9285659
2 changed files with 18 additions and 1 deletions

View File

@@ -105,3 +105,16 @@ StringCompletion::insert_vector (std::vector<Glib::ustring> strVector, bool nore
this->add_string (s, norepeat);
}
}
bool
StringCompletion::match_anywhere (Glib::ustring const & str, Gtk::TreeModel::const_iterator const & iter)
{
Glib::ustring r = Gtk::TreeModel::Row (*iter)[m_completionRecord.col_text];
return r.find (str) != Glib::ustring::npos;
}
void
StringCompletion::set_match_anywhere ()
{
set_match_func (sigc::mem_fun (this, &StringCompletion::match_anywhere));
}