summaryrefslogtreecommitdiff
path: root/src/selectors.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2016-01-26 07:23:18 +0000
committerMaxime Coste <frrrwww@gmail.com>2016-01-26 07:23:18 +0000
commit04119d6207c871962dd17106b034ce229df580b9 (patch)
tree6ba7813ee052b436d19f902015737a6cca68f720 /src/selectors.hh
parent4f07632ac0e66fd3889a47bf8eb424d61de1afb5 (diff)
Make find_surrounding more reusable and add unit tests
Diffstat (limited to 'src/selectors.hh')
-rw-r--r--src/selectors.hh5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/selectors.hh b/src/selectors.hh
index f718cbd3..c38711a8 100644
--- a/src/selectors.hh
+++ b/src/selectors.hh
@@ -40,6 +40,11 @@ void skip_while_reverse(Iterator& it, const BeginIterator& begin, T condition)
using Utf8Iterator = utf8::iterator<BufferIterator, utf8::InvalidPolicy::Pass>;
+inline Selection utf8_range(const BufferIterator& first, const BufferIterator& last)
+{
+ return {first.coord(), last.coord()};
+}
+
inline Selection utf8_range(const Utf8Iterator& first, const Utf8Iterator& last)
{
return {first.base().coord(), last.base().coord()};