diff options
Diffstat (limited to 'src/selection.hh')
| -rw-r--r-- | src/selection.hh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/selection.hh b/src/selection.hh index 38eb6fd1..52267198 100644 --- a/src/selection.hh +++ b/src/selection.hh @@ -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; } |
