From 6e20e7e61e359610bdc5c1e190bee5a44a74602b Mon Sep 17 00:00:00 2001 From: Himadri Bhattacharjee <107522312+lavafroth@users.noreply.github.com> Date: Mon, 1 Dec 2025 15:37:30 +0530 Subject: [PATCH] fix(ui): capture tabs in the editor --- src/static/script.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/static/script.js b/src/static/script.js index 78bee67..a46548d 100644 --- a/src/static/script.js +++ b/src/static/script.js @@ -18,6 +18,21 @@ function doApi(message) { body: JSON.stringify(message) }) } + + +editor.addEventListener("keydown", (e) => { + if (e.keyCode === 9) { + e.preventDefault(); + + editor.setRangeText( + " ", + editor.selectionStart, + editor.selectionStart, + "end" + ); + } +}); + editor.addEventListener('keyup', (_) => { clearTimeout(timer); timer = setTimeout(() => {