From a9a59628ebd841b2ed9a76967b156f7848cd5b46 Mon Sep 17 00:00:00 2001
From: Erallie <31375589+Erallie@users.noreply.github.com>
Date: Sun, 1 Dec 2024 11:22:48 -0700
Subject: [PATCH] Made insert timestamp replace selection instead

---
 main.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/main.ts b/main.ts
index d0f0a1f..b8f9fd7 100644
--- a/main.ts
+++ b/main.ts
@@ -300,7 +300,7 @@ class TimestampModal extends Modal {
                         insertedText = date.format('X');
                     else
                         insertedText = `<t:${date.format('X')}:${button.id}>`;
-                    editor.replaceRange(insertedText, cursor);
+                    editor.replaceSelection(insertedText);
                     editor.setCursor(cursor.line, cursor.ch + insertedText.length);
                     modal.close();
                 })