From 14f980e4e0ec7eea4d377bfae57fcc70e6842e23 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 12 Nov 2012 20:27:56 +0100 Subject: [PATCH] move overlaps function to selection.hh --- src/editor.cc | 7 ------- src/selection.hh | 8 ++++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/editor.cc b/src/editor.cc index 9694b501..36931e80 100644 --- a/src/editor.cc +++ b/src/editor.cc @@ -99,13 +99,6 @@ std::vector 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) 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 SelectionAndCapturesList; }