summaryrefslogtreecommitdiff
path: root/src/selection.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2012-11-12 20:27:56 +0100
committerMaxime Coste <frrrwww@gmail.com>2012-11-12 20:27:56 +0100
commit14f980e4e0ec7eea4d377bfae57fcc70e6842e23 (patch)
treef4844bf647d3a0fae785a9eaff295d2fc2890e3e /src/selection.hh
parent77272db0fd28af7ee9ade28434c52e628e4d5a32 (diff)
move overlaps function to selection.hh
Diffstat (limited to 'src/selection.hh')
-rw-r--r--src/selection.hh8
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;
}