From 6bbfa899da37beda5d3185daf51d5145c42d0055 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 2 Nov 2026 07:15:16 +0000 Subject: [PATCH] Send the editor's code untrimmed so line numbers line up run() posted `el.code.value.trim()`, but the gutter, walkthrough and "jump to line" buttons index the untrimmed editor text. Any leading blank lines were dropped before analysis, so every note landed that many lines above the code it describes: with two blank lines first, `def double` on editor line 4 was reported on line 2. The code is now sent exactly as typed, and the empty check still uses the trimmed text. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UigC7feaY8NkAy9oay3GDW --- web/static/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/static/app.js b/web/static/app.js index 8b85248..3bf074c 100644 --- a/web/static/app.js +++ b/web/static/app.js @@ -153,8 +153,10 @@ /* ---------------------------------------------------------------- request */ async function run() { if (state.busy) return; - const code = el.code.value.trim(); - if (!code) return toast("Nothing to explain — paste some code first."); + // Sent exactly as typed. Trimming dropped leading blank lines, so every line number + // in the response landed that many lines above the editor line it describes. + const code = el.code.value; + if (!code.trim()) return toast("Nothing to explain — paste some code first."); state.busy = true; el.run.disabled = true;