From 3036763d085900b72d51adccaa2a26d5b4bf0ebb Mon Sep 17 00:00:00 2001 From: Andy Dixon Date: Sun, 10 May 2026 18:11:36 +0100 Subject: [PATCH] Show blank source lines as blank highlightSource returns a 'No preview available' placeholder for empty input, so every empty line in the source viewer showed that text. --- web/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app.js b/web/app.js index a86ac7f..de32e6a 100644 --- a/web/app.js +++ b/web/app.js @@ -309,7 +309,7 @@ function mountSourceViewer(file){ frame=0;const version=++drawVersion,start=Math.max(0,Math.floor(viewer.scrollTop/lineHeight)-12),count=Math.ceil(viewer.clientHeight/lineHeight)+24,chunkStart=Math.floor(start/600)*600; const lines=await loadSourceChunk(file,chunkStart,600);if(version!==drawVersion||!viewer.isConnected)return; const offset=start-chunkStart,end=Math.min(lines.length,offset+count);windowElement.style.transform=`translateY(${start*lineHeight}px)`; - windowElement.innerHTML=lines.slice(offset,end).map((line,index)=>`${highlightSource(line,file)||' '}`).join(''); + windowElement.innerHTML=lines.slice(offset,end).map((line,index)=>`${line?highlightSource(line,file):' '}`).join(''); }; viewer.addEventListener('scroll',()=>{if(!frame)frame=requestAnimationFrame(draw);},{passive:true});draw(); }