Skip to content

Commit 25bcc71

Browse files
committed
Fix atomic marker comparison logic
Closes #2629
1 parent f7b4edf commit 25bcc71

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/codemirror.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5422,8 +5422,8 @@
54225422
var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);
54235423
var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);
54245424
if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) continue;
5425-
if (fromCmp <= 0 && (cmp(found.to, from) || extraRight(sp.marker) - extraLeft(marker)) > 0 ||
5426-
fromCmp >= 0 && (cmp(found.from, to) || extraLeft(sp.marker) - extraRight(marker)) < 0)
5425+
if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||
5426+
fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))
54275427
return true;
54285428
}
54295429
}

0 commit comments

Comments
 (0)