diff --git a/lib/codemirror.js b/lib/codemirror.js
index <HASH>..<HASH> 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -3555,7 +3555,17 @@ window.CodeMirror = (function() {
     if (!markers) return null;
     var parts = [{from: from, to: to}];
     for (var i = 0; i < markers.length; ++i) {
-      var m = markers[i].find();
+      var mk = markers[i], m = mk.find();
+      if (mk.inclusiveLeft) {
+        m.from = {line: m.from.line, ch: m.from.ch - 1};
+        if (m.from.ch < 0 && m.from.line > doc.first)
+          m.from = {line: m.from.line - 1, ch: getLine(doc, m.from.line - 1).text.length};
+      }
+      if (mk.inclusiveRight) {
+        m.to = {line: m.to.line, ch: m.to.ch + 1};
+        if (m.to.line < doc.first + doc.size - 1 && m.to.ch > getLine(doc, m.to.line).text.length)
+          m.to = {line: m.to.line + 1, ch: 0};
+      }
       for (var j = 0; j < parts.length; ++j) {
         var p = parts[j];
         if (!posLess(m.from, p.to) || posLess(m.to, p.from)) continue;
Take inclusiveLeft/Right into account when preventing editing of readOnly spans