summaryrefslogtreecommitdiff
path: root/src/selection.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2019-02-11 21:48:09 +1100
committerMaxime Coste <mawww@kakoune.org>2019-02-11 21:48:09 +1100
commit94796509a093e5b7d75ab3423b13a5ba1b4beb5c (patch)
tree22a482bc30ea9925f7bacf9a8ed494fac7fc4b85 /src/selection.cc
parent5c0175d90a583578f4e1575c3154aa39686c1545 (diff)
Fix bug in 'itersel' handling that could result in unsorted selections
Diffstat (limited to 'src/selection.cc')
-rw-r--r--src/selection.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/selection.cc b/src/selection.cc
index 5e3ff2e7..00e750a5 100644
--- a/src/selection.cc
+++ b/src/selection.cc
@@ -50,6 +50,12 @@ void SelectionList::set(Vector<Selection> list, size_t main)
check_invariant();
}
+bool compare_selections(const Selection& lhs, const Selection& rhs)
+{
+ const auto lmin = lhs.min(), rmin = rhs.min();
+ return lmin == rmin ? lhs.max() < rhs.max() : lmin < rmin;
+}
+
namespace
{
@@ -78,12 +84,6 @@ BufferCoord update_erase(BufferCoord coord, BufferCoord begin, BufferCoord end)
return coord;
} */
-bool compare_selections(const Selection& lhs, const Selection& rhs)
-{
- const auto lmin = lhs.min(), rmin = rhs.min();
- return lmin == rmin ? lhs.max() < rhs.max() : lmin < rmin;
-}
-
template<typename Iterator, typename OverlapsFunc>
Iterator merge_overlapping(Iterator begin, Iterator end, size_t& main, OverlapsFunc overlaps)
{