Skip to content

Commit e120175

Browse files
committed
[scrollpastend addon] Work around potential infinite event-handler recursion
See https://discuss.codemirror.net/t/range-error-with-scrollpastend-addon/773
1 parent 592b4d1 commit e120175

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

addon/scroll/scrollpastend.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
if (cm.state.scrollPastEndPadding != padding) {
4141
cm.state.scrollPastEndPadding = padding;
4242
cm.display.lineSpace.parentNode.style.paddingBottom = padding;
43+
cm.off("refresh", updateBottomMargin);
4344
cm.setSize();
45+
cm.on("refresh", updateBottomMargin);
4446
}
4547
}
4648
});

0 commit comments

Comments
 (0)