move overlaps function to selection.hh
This commit is contained in:
parent
77272db0fd
commit
14f980e4e0
|
@ -99,13 +99,6 @@ std::vector<String> Editor::selections_content() const
|
|||
return contents;
|
||||
}
|
||||
|
||||
static bool overlaps(const SelectionAndCaptures& lhs,
|
||||
const SelectionAndCaptures& rhs)
|
||||
{
|
||||
return (lhs.first() <= rhs.first() and lhs.last() >= rhs.first()) or
|
||||
(lhs.first() <= rhs.last() and lhs.last() >= rhs.last());
|
||||
}
|
||||
|
||||
static void merge_overlapping(SelectionAndCapturesList& selections)
|
||||
{
|
||||
for (size_t i = 0; i < selections.size(); ++i)
|
||||
|
|
|
@ -75,6 +75,14 @@ struct SelectionAndCaptures
|
|||
const BufferIterator& last() const { return selection.last(); }
|
||||
};
|
||||
|
||||
inline bool overlaps(const SelectionAndCaptures& lhs,
|
||||
const SelectionAndCaptures& rhs)
|
||||
{
|
||||
return (lhs.first() <= rhs.first() and lhs.last() >= rhs.first()) or
|
||||
(lhs.first() <= rhs.last() and lhs.last() >= rhs.last());
|
||||
}
|
||||
|
||||
|
||||
typedef std::vector<SelectionAndCaptures> SelectionAndCapturesList;
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user