From b0da9a579d1f871b8d484fbc22b73c84297bc8ff Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Sun, 25 Mar 2018 19:24:52 +0200 Subject: [PATCH] Fix numbering line when plugin add padding-top (like ep_page_view) --- src/static/js/ace2_inner.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index df9c9642..90cefa50 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -5404,8 +5404,8 @@ function Ace2Inner(){ // height is taken to be the top offset of the next line. If we // didn't do this special case, we would miss out on any top margin // included on the first line. The default stylesheet doesn't add - // extra margins, but plugins might. - h = b.nextSibling.offsetTop; + // extra margins/padding, but plugins might. + h = b.nextSibling.offsetTop - window.getComputedStyle(doc.body).getPropertyValue("padding-top"); } else { h = b.nextSibling.offsetTop - b.offsetTop; }