added regex highlights
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace chatterino {
|
||||
namespace util {
|
||||
|
||||
template <typename T>
|
||||
struct SharedPtrElementLess {
|
||||
bool operator()(const std::shared_ptr<T> &a, const std::shared_ptr<T> &b) const
|
||||
{
|
||||
return a->operator<(*b);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace util
|
||||
} // namespace chatterino
|
||||
@@ -103,17 +103,19 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
template <typename TVectorItem>
|
||||
template <typename TVectorItem, typename Compare>
|
||||
class SortedSignalVector : public BaseSignalVector<TVectorItem>
|
||||
{
|
||||
public:
|
||||
virtual int insertItem(const TVectorItem &item, int index = -1, void *caller = 0) override
|
||||
virtual int insertItem(const TVectorItem &item, int proposedIndex = -1,
|
||||
void *caller = 0) override
|
||||
{
|
||||
util::assertInGuiThread();
|
||||
|
||||
int index = this->vector.insert(
|
||||
std::lower_bound(this->vector.begin(), this->vector.end(), item), item) -
|
||||
this->vector.begin();
|
||||
int index =
|
||||
this->vector.insert(
|
||||
std::lower_bound(this->vector.begin(), this->vector.end(), item, Compare{}), item) -
|
||||
this->vector.begin();
|
||||
typename ReadOnlySignalVector<TVectorItem>::ItemArgs args{item, index, caller};
|
||||
this->itemInserted.invoke(args);
|
||||
this->invokeDelayedItemsChanged();
|
||||
|
||||
Reference in New Issue
Block a user