diff --git a/lib/codemirror.js b/lib/codemirror.js
index <HASH>..<HASH> 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -4312,7 +4312,7 @@ window.CodeMirror = (function() {
     if (!order) return f(from, to, "ltr");
     for (var i = 0; i < order.length; ++i) {
       var part = order[i];
-      if (part.from < to && part.to > from)
+      if (part.from < to && part.to > from || from == to && part.to == from)
         f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr");
     }
   }
Fix bug in iterateBidiSections

When the from and to arguments were equal and the line had an order, it
would never call the callback.

Issue #<I>