Skip to content

Commit 24d6057

Browse files
Dominator008marijnh
authored andcommitted
Fix one more bad assumption in skipAtomic
Closes codemirror#3846.
1 parent f95803c commit 24d6057

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/codemirror.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2258,7 +2258,8 @@
22582258

22592259
if (oldPos) {
22602260
var near = m.find(dir < 0 ? 1 : -1), diff;
2261-
if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft) near = movePos(doc, near, -dir, line);
2261+
if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)
2262+
near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null);
22622263
if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))
22632264
return skipAtomicInner(doc, near, pos, dir, mayClear);
22642265
}

0 commit comments

Comments
 (0)