Skip to content

Commit

Permalink
Made insert timestamp replace selection instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Erallie committed Dec 1, 2024
1 parent f14159c commit a9a5962
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
})
Expand Down

0 comments on commit a9a5962

Please sign in to comment.