diff --git a/lib/libimhex/include/hex/providers/buffered_reader.hpp b/lib/libimhex/include/hex/providers/buffered_reader.hpp index a63915dca..8dd523df6 100644 --- a/lib/libimhex/include/hex/providers/buffered_reader.hpp +++ b/lib/libimhex/include/hex/providers/buffered_reader.hpp @@ -81,6 +81,19 @@ namespace hex::prv { return copy; } + Iterator& operator--() { + this->m_address--; + + return *this; + } + + Iterator operator--(int) { + auto copy = *this; + this->m_address--; + + return copy; + } + Iterator& operator+=(i64 offset) { this->m_address += offset; @@ -156,6 +169,19 @@ namespace hex::prv { return copy; } + ReverseIterator& operator--() { + this->m_address++; + + return *this; + } + + ReverseIterator operator--(int) { + auto copy = *this; + this->m_address++; + + return copy; + } + ReverseIterator& operator+=(i64 offset) { this->m_address -= offset; diff --git a/plugins/builtin/source/content/views/view_find.cpp b/plugins/builtin/source/content/views/view_find.cpp index 9316aceb8..db8bddba2 100644 --- a/plugins/builtin/source/content/views/view_find.cpp +++ b/plugins/builtin/source/content/views/view_find.cpp @@ -300,6 +300,8 @@ namespace hex::plugin::builtin { matchedBytes = 0; } } else { + if (matchedBytes > 0) + it -= matchedBytes; matchedBytes = 0; } }