Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto jump to cursor is triggered twice on new file creation #1381

Open
jottr opened this issue May 21, 2024 · 4 comments
Open

Auto jump to cursor is triggered twice on new file creation #1381

jottr opened this issue May 21, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@jottr
Copy link

jottr commented May 21, 2024

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 jottr added the bug Something isn't working label May 21, 2024
@Zachatoo
Copy link
Collaborator

Can you try updating to the latest version of Templater, 2.3.2?

@Zachatoo Zachatoo added the awaiting response More information has been requested, waiting to hear from the submitter label May 21, 2024
@jottr
Copy link
Author

jottr commented May 21, 2024

I just updated to 2.3.2. The issue remains.
Are you able to reproduce it @Zachatoo?

@Zachatoo
Copy link
Collaborator

I can reproduce now when using the "Create new note from template" command, I could not with the "Open insert template modal" command.

@Zachatoo Zachatoo removed the awaiting response More information has been requested, waiting to hear from the submitter label May 21, 2024
@Zachatoo Zachatoo changed the title tp.file.cursor() doesn't work Auto jump to cursor is triggered twice on new file creation May 21, 2024
@jottr
Copy link
Author

jottr commented May 21, 2024

This is what I am seeing too and what is being corroborated by another user on Reddit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants