summaryrefslogtreecommitdiff
path: root/src/selection.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-05-03 13:53:23 +0200
committerMaxime Coste <frrrwww@gmail.com>2013-05-03 18:44:26 +0200
commit33740d06eed248787beed8b0f07c83bb8cc93bf4 (patch)
tree2710a3130c20476983368af181a543da72d54d21 /src/selection.hh
parent564cfb084e6098625c64de6a75fb7441d71287f6 (diff)
Editor: tweak behaviour on undo/redo when selecting modified ranges
Diffstat (limited to 'src/selection.hh')
-rw-r--r--src/selection.hh6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/selection.hh b/src/selection.hh
index d24bc87e..e5361a4d 100644
--- a/src/selection.hh
+++ b/src/selection.hh
@@ -45,6 +45,12 @@ inline bool overlaps(const Range& lhs, const Range& rhs)
(lhs.first() <= rhs.last() and lhs.last() >= rhs.last());
}
+inline bool touches(const Range& lhs, const Range& rhs)
+{
+ return lhs.begin() <= rhs.begin() ? lhs.end() >= rhs.begin()
+ : lhs.begin() <= rhs.end();
+}
+
using CaptureList = std::vector<String>;
// A selection is a Range, associated with a CaptureList