summaryrefslogtreecommitdiff
path: root/src/selectors.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-03-29 08:55:45 +0000
committerMaxime Coste <frrrwww@gmail.com>2014-03-29 08:55:45 +0000
commitda9d099f3bdf1806b647fd8deabac60552bb04b2 (patch)
tree1986b1e48ab3617e420b7936649d4bdbc5d907ab /src/selectors.cc
parentc38e14958fd53df2b697319920cd4d3c285ad372 (diff)
Remove Range struct, merge it back in Selection
Diffstat (limited to 'src/selectors.cc')
-rw-r--r--src/selectors.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/selectors.cc b/src/selectors.cc
index e800643d..33e9216f 100644
--- a/src/selectors.cc
+++ b/src/selectors.cc
@@ -76,10 +76,10 @@ Selection select_matching(const Buffer& buffer, const Selection& selection)
// c++14 will add std::optional, so we use boost::optional until then
using boost::optional;
-static optional<Range> find_surrounding(const Buffer& buffer,
- BufferCoord coord,
- CodepointPair matching,
- ObjectFlags flags, int init_level)
+static optional<Selection> find_surrounding(const Buffer& buffer,
+ BufferCoord coord,
+ CodepointPair matching,
+ ObjectFlags flags, int init_level)
{
const bool to_begin = flags & ObjectFlags::ToBegin;
const bool to_end = flags & ObjectFlags::ToEnd;
@@ -103,7 +103,7 @@ static optional<Range> find_surrounding(const Buffer& buffer,
--first;
}
if (level != 0 or *first != matching.first)
- return optional<Range>{};
+ return optional<Selection>{};
}
Utf8Iterator last = pos;
@@ -124,7 +124,7 @@ static optional<Range> find_surrounding(const Buffer& buffer,
++last;
}
if (level != 0 or last == buffer.end())
- return optional<Range>{};
+ return optional<Selection>{};
}
if (flags & ObjectFlags::Inner)