src/Pure/PIDE/text.scala
changeset 58749 83b0f633190e
parent 57912 dd9550f84106
child 60215 5fb4990dfc73
--- a/src/Pure/PIDE/text.scala	Tue Oct 21 15:21:44 2014 +0200
+++ b/src/Pure/PIDE/text.scala	Tue Oct 21 17:49:51 2014 +0200
@@ -51,6 +51,8 @@
     def is_singularity: Boolean = start == stop
     def inflate_singularity: Range = if (is_singularity) Range(start, start + 1) else this
 
+    def touches(i: Offset): Boolean = start <= i && i <= stop
+
     def contains(i: Offset): Boolean = start == i || start < i && i < stop
     def contains(that: Range): Boolean = this.contains(that.start) && that.stop <= this.stop
     def overlaps(that: Range): Boolean = this.contains(that.start) || that.contains(this.start)