From 0dcd1c3616d87a3ef023233b031709aa402cf175 Mon Sep 17 00:00:00 2001 From: David Contreras Date: Wed, 8 Jan 2025 10:27:42 -0600 Subject: [PATCH] Fixed multi line highlight --- main.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/main.js b/main.js index c1ffd61..5a7554f 100644 --- a/main.js +++ b/main.js @@ -207,11 +207,7 @@ function updateSelection() { const thisNode = code; const fromLine = parseInt(thisNode.getAttribute('data-from-line'), 10); const toLine = parseInt(thisNode.getAttribute('data-to-line'), 10); - if ( - (fromLine >= selectedFrom) && (fromLine <= selectedTo) - || - (toLine >= selectedFrom) && (toLine <= selectedTo) - ) { + if ((fromLine <= selectedTo) && (toLine >= selectedFrom)) { code.classList.add('highlight'); code.scrollIntoView({ block: 'nearest', inline: 'start' }); } else {