From e1201757de3ec5621a7271f32bd9ac2280a0cf3f Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Mon, 20 Jun 2016 11:39:43 +0200 Subject: [PATCH] [scrollpastend addon] Work around potential infinite event-handler recursion See https://discuss.codemirror.net/t/range-error-with-scrollpastend-addon/773 --- addon/scroll/scrollpastend.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addon/scroll/scrollpastend.js b/addon/scroll/scrollpastend.js index 008ae4c7ba..a2ed089b48 100644 --- a/addon/scroll/scrollpastend.js +++ b/addon/scroll/scrollpastend.js @@ -40,7 +40,9 @@ if (cm.state.scrollPastEndPadding != padding) { cm.state.scrollPastEndPadding = padding; cm.display.lineSpace.parentNode.style.paddingBottom = padding; + cm.off("refresh", updateBottomMargin); cm.setSize(); + cm.on("refresh", updateBottomMargin); } } });