Skip to content

Commit

Permalink
Merge pull request #758 from garygreen/highlight-speed
Browse files Browse the repository at this point in the history
Speed up syntax highlighting
  • Loading branch information
denis-sokolov committed Jul 13, 2023
2 parents 7d330e2 + b88e6b2 commit b5e231c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Whoops/Resources/js/whoops.base.js
Expand Up @@ -25,7 +25,7 @@ Zepto(function($) {
* highlight the current line
*/
var renderCurrentCodeblock = function(id) {
Prism.highlightAll();
Prism.highlightAllUnder(document.querySelector('.frame-code-container .frame-code.active'));
highlightCurrentLine();
}

Expand Down Expand Up @@ -153,9 +153,6 @@ Zepto(function($) {
}
});

// Render late enough for highlightCurrentLine to be ready
renderCurrentCodeblock();

// Avoid to quit the page with some protocol (e.g. IntelliJ Platform REST API)
$ajaxEditors.on('click', function(e){
e.preventDefault();
Expand Down Expand Up @@ -185,4 +182,7 @@ Zepto(function($) {
e.preventDefault();
setActiveFramesTab($(this));
});

// Render late enough for highlightCurrentLine to be ready
renderCurrentCodeblock();
});

0 comments on commit b5e231c

Please sign in to comment.