fixed not being able to select text backwards
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
namespace chatterino {
|
||||
@@ -23,19 +24,13 @@ struct SelectionItem {
|
||||
|
||||
bool operator<(const SelectionItem &b) const
|
||||
{
|
||||
if (this->messageIndex < b.messageIndex) {
|
||||
return true;
|
||||
}
|
||||
if (this->messageIndex == b.messageIndex &&
|
||||
this->charIndex < b.charIndex) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return std::tie(this->messageIndex, this->charIndex) <
|
||||
std::tie(b.messageIndex, b.charIndex);
|
||||
}
|
||||
|
||||
bool operator>(const SelectionItem &b) const
|
||||
{
|
||||
return this->operator!=(b) && b.operator<(*this);
|
||||
return b.operator<(*this);
|
||||
}
|
||||
|
||||
bool operator==(const SelectionItem &b) const
|
||||
|
||||
Reference in New Issue
Block a user