Templater icon indicating copy to clipboard operation
Templater copied to clipboard

Auto jump to cursor is triggered twice on new file creation

Open jottr opened this issue 1 month ago • 4 comments

Plugin information (please complete the following information):

  • OS: [MacOS]
  • Templater version: [2.3.1]
  • Obsidian version: [1.5.12 ]

Given the following template:

---
id: test.template
aliases: []
tags: []
---

foo: <% tp.file.cursor(1) %>
bar: <% tp.file.cursor(2) %>
bar2: <% tp.file.cursor(2) %>
- <% tp.file.cursor(3) %>
- <% tp.file.cursor(4) %>


And "Automatic jump to cursor" enabled in settings

image

Expected behavior

The cursor should jump to the first cursor position of foo: <% tp.file.cursor(1) %>.

1. The layout is inconsistent

image

Note that foo, bar and bar2 don't show the templater instructions, whereas both bullet points do.

2. The cursor skips the first instance

image

The cursor skips foo: <% tp.file.cursor(1) %> and jumps to the multi-cusor position of bar: <% tp.file.cursor(2) %> instead

Additional context

All other plugins have been disabled.

jottr avatar May 21 '24 16:05 jottr