fix: Filtering search occurrences in Find view with multiple files being broken
Fixes #685
This commit is contained in:
parent
7ef11f566b
commit
0a115a3c03
@ -73,11 +73,11 @@ namespace hex::plugin::builtin {
|
||||
|
||||
std::map<prv::Provider*, std::vector<Occurrence>> m_foundOccurrences, m_sortedOccurrences;
|
||||
std::map<prv::Provider*, OccurrenceTree> m_occurrenceTree;
|
||||
std::map<prv::Provider*, std::string> m_currFilter;
|
||||
|
||||
TaskHolder m_searchTask;
|
||||
bool m_settingsValid = false;
|
||||
|
||||
std::string m_currFilter;
|
||||
private:
|
||||
static std::vector<Occurrence> searchStrings(Task &task, prv::Provider *provider, Region searchRegion, SearchSettings::Strings settings);
|
||||
static std::vector<Occurrence> searchSequence(Task &task, prv::Provider *provider, Region searchRegion, SearchSettings::Bytes settings);
|
||||
|
@ -524,11 +524,11 @@ namespace hex::plugin::builtin {
|
||||
auto &currOccurrences = this->m_sortedOccurrences[provider];
|
||||
|
||||
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x);
|
||||
if (ImGui::InputTextWithHint("##filter", "hex.builtin.common.filter"_lang, this->m_currFilter)) {
|
||||
this->m_sortedOccurrences = this->m_foundOccurrences;
|
||||
if (ImGui::InputTextWithHint("##filter", "hex.builtin.common.filter"_lang, this->m_currFilter[provider])) {
|
||||
this->m_sortedOccurrences[provider] = this->m_foundOccurrences[provider];
|
||||
|
||||
currOccurrences.erase(std::remove_if(currOccurrences.begin(), currOccurrences.end(), [this, provider](const auto ®ion) {
|
||||
return !this->decodeValue(provider, region).contains(this->m_currFilter);
|
||||
return !this->decodeValue(provider, region).contains(this->m_currFilter[provider]);
|
||||
}), currOccurrences.end());
|
||||
}
|
||||
ImGui::PopItemWidth();
|
||||
|
Loading…
Reference in New Issue
Block a user