From b1570a1ea1448f5509241de01f1a18d0a9c81cc4 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath <2+defunkt@users.noreply.github.com> Date: Sun, 21 Sep 2025 14:21:46 -0700 Subject: [PATCH] weak cursor --- src/js/cursor.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/js/cursor.ts b/src/js/cursor.ts index 01471ce..471566e 100644 --- a/src/js/cursor.ts +++ b/src/js/cursor.ts @@ -8,16 +8,11 @@ let cmdCursor: HTMLTextAreaElement export function initCursor() { cmdCursor = $("command-cursor") as HTMLTextAreaElement - setCursor() - cmdInput.addEventListener("keydown", showCursor) + showCursor() } -function setCursor() { - cmdCursor.value = cmdCursor.value.endsWith(cursor) ? "" : " ".repeat(cmdInput.value.length) + cursor -} - -function showCursor(e: any) { +function showCursor(e: KeyboardEvent | any = {}) { if (e.key === "Enter" && !e.shiftKey) { cmdCursor.value = cursor return