Merge pull request #3352 from ldidry/fix-line-numbers

Fix line number display when plugin add padding-top (like ep_page_view)
This commit is contained in:
John McLear 2018-04-03 12:57:55 +01:00 committed by GitHub
commit eb9875ee32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}