Skip to content

Commit d52fb7a

Browse files
author
p01
committed
Improved context adjustment of the line highlighting
1 parent bbf6bd9 commit d52fb7a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/resource-manager/resource_detail_view.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ cls.ResourceDetailView = function(id, name, container_class, html, default_handl
3838
var RESOURCE_DETAIL_CONTAINER_CLASSNAME = "resource-detail-container";
3939
var TEXT = document.TEXT_NODE;
4040
var ELE = document.ELEMENT_NODE;
41+
var HIGHLIGHT_CONTEXT_SIZE = 8;
4142
this._span = document.createElement("span");
4243
this._span.textContent = " ";
4344
this._line_count = 0;
@@ -91,7 +92,7 @@ cls.ResourceDetailView = function(id, name, container_class, html, default_handl
9192

9293
var scroll_position = scroll_top + this._tops[0] - container_top;
9394
if (scroll_position <= this._root_ele.parentNode.clientHeight)
94-
scroll_position -= 64;
95+
scroll_position -= HIGHLIGHT_CONTEXT_SIZE * window.defaults["js-source-line-height"];
9596

9697
this._root_ele.scrollTop = scroll_position;
9798
this._line_found = true;

0 commit comments

Comments
 (0)