SilentVoid13/Templater

Duplication bug when using Multiple Cursors

VerAn1015 opened this issue · 0 comments

Plugin information

  • OS: Windows 10
  • Templater version: 2.7.1
  • Obsidian version: 1.6.7
  • Templater settings: [Template folder location: "Templates/"]

Describe the bug
I have set up a custom highlight with a CSS snippet and use % tp.file.selection() % with it. It works fine when used normally. The problem is when using multiple cursors which Obsidian supports natively. It duplicates the most recent selected text when applying the template with templater. More info below.

Template file content: <mark class="red"><% tp.file.selection() %></mark>

<mark class="red">highlight 5</mark>
<mark class="red">highlight 5</mark>
<mark class="red">highlight 5</mark>
<mark class="red">highlight 5</mark>
<mark class="red">highlight 5</mark>

Expected behavior
Does not duplicate the highlighted text when using the template with multiple cursors.

<mark class="red">highlight 1</mark>
<mark class="red">highlight 2</mark>
<mark class="red">highlight 3</mark>
<mark class="red">highlight 4</mark>
<mark class="red">highlight 5</mark>

Screenshots
Template File
image

Bug in action
Obsidian_yM8S1v7pa7

Additional context
Tested in Sandbox vault.

SYSTEM INFO:
Obsidian version: v1.6.7
Installer version: v1.6.7
Operating system: Windows 10 Home Single Language 10.0.19045
Login status: not logged in
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 1
Restricted mode: off
Plugins installed: 1
Plugins enabled: 1
1: Templater v2.7.1