You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Plugin information (please complete the following information):
OS: xubuntu 22.04.4 LTS
Templater version: 2.3.3
Obsidian version: v1.6.7
Templater settings: [e.g. Template folder location: "Templates/", Timeout: "5" (add the templates not working with their associated command)]
Describe the bug
In a file created with the following template, using the hot key for Templater: Jump to next cursor location while in preview mode places the cursor before the brackets instead of within them
[[<% tp.file.cursor(1) %>#heading1]]
Doing the same while the editor is in source mode performs as expected Expected behavior
Hitting the cursor placement hot key should put the cursor directly after [[
Screenshots
Highlighted to show syntax:
As it appears in editor preview mode:
After hitting hot key in preview mode (bad behavior):
After hitting hot key in source mode (expected behavior):
Other Notes:
I have found that I often can not use the mouse to place the cursor inside the link to edit the text (change the cursor from 2 to 3, for example). When I click on the text the cursor is placed outside the final square bracket and I have to use arrow keys to navigate into it. While this feels related, I'm not sure because I find the behavior is the same in both source and regular preview editor modes.
The text was updated successfully, but these errors were encountered:
Just adding that this doesn't appear to be limited to "headings" and instead seems to be happening with any wikilink and tp.file.cursor() combination. May want to update the issue title to reflect this.
My "Insert wikilink from selection" template snippet no longer works as expected. The cursor is either placed outside the start of the wikilink brackets ([[), or it is placed inside the brackets but does not trigger the native Obsidian auto-complete dropdown menu. Pressing the spacebar will bring up the native Obsidian auto-complete dropdown menu, which leads me to believe tp.file.cursor() isn't firing the required event(s).
Template snippet being used (this is currently called via Commander, however calling from the Command Palette has the same effect).
Tejeev
changed the title
When using tp.file.cursor inside an internal link with a heading, cursor is placed before the link
When using tp.file.cursor inside an internal link, cursor is placed before the link
Aug 28, 2024
Plugin information (please complete the following information):
Describe the bug
In a file created with the following template, using the hot key for
Templater: Jump to next cursor location
while in preview mode places the cursor before the brackets instead of within themDoing the same while the editor is in source mode performs as expected
Expected behavior
Hitting the cursor placement hot key should put the cursor directly after
[[
Screenshots
Highlighted to show syntax:
As it appears in editor preview mode:
After hitting hot key in preview mode (bad behavior):
After hitting hot key in source mode (expected behavior):
Other Notes:
I have found that I often can not use the mouse to place the cursor inside the link to edit the text (change the cursor from 2 to 3, for example). When I click on the text the cursor is placed outside the final square bracket and I have to use arrow keys to navigate into it. While this feels related, I'm not sure because I find the behavior is the same in both source and regular preview editor modes.
The text was updated successfully, but these errors were encountered: