Templates Insert date and time commands don't replace selected text

I often run into this when trying to update a date in my notes. I select the old date and use the hotkey to insert the new date, but the selected text is not removed. I have to delete it first, which feels unintuitive.

Steps to reproduce

  1. Create a new note in the Sandbox vault.
  2. Make sure the core plugin Templates is enabled.
  3. Type some text and select it.
  4. Open the Command Palette.
  5. Run “Templates: Insert current date” or “Templates: Insert current time”.

Expected result

The selected text is deleted and then the current date or time is inserted at the cursor position.

Actual result

The insert command runs, but the selected text is not deleted.

For comparison, the command Insert horizontal rule replaces the selected text as expected, which feels more intuitive.

Environment

SYSTEM INFO:
	Obsidian version: v1.11.7
	Installer version: v1.11.7
	Operating system: Windows 11 Pro
	Login status: not logged in
	Language: en
	Insider build toggle: off
	Live preview: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Restricted mode: on

RECOMMENDATIONS:
	none

Additional information

insert-obsidian-bug

1 Like

thanks