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: Windows 10
Templater version: 1.12.0
Obsidian version: 0.14.15
Templater settings: default settings
Describe the bug
When there are more than 65,536 (2^16) characters in a file after tp.file.cursor() finishes it's replacement, the cursor is put to the start of the line rather than to the correct position.
If there are less than 2^16 characters after replacement, everything works fine.
Expected behavior
The cursor should jump to the correct position on the line.
Screenshots
Pay attention to the character count in the bottom right
Obsidian_2022-06-28_18-24-17.mp4
Additional context
It is possible that this is an issue with the EditorPosition interface, which I believe implements position (or ch) as a TypeScript number
I'm seeing this as well. I have a daily log file that I just append to the beginning of and now when I apply the template for the daily log my cursor is positioned before rather than after the list marker.
Update for anyone else experiencing this issue. I have made a quick plugin fix that can be used in conjunction with Templater as a replacement for the template-cursor functionality. Download found on my github profile here.
Plugin information (please complete the following information):
Describe the bug
When there are more than 65,536 (2^16) characters in a file after
tp.file.cursor()
finishes it's replacement, the cursor is put to the start of the line rather than to the correct position.If there are less than 2^16 characters after replacement, everything works fine.
Expected behavior
The cursor should jump to the correct position on the line.
Screenshots
Pay attention to the character count in the bottom right
Obsidian_2022-06-28_18-24-17.mp4
Additional context
It is possible that this is an issue with the
EditorPosition
interface, which I believe implements position (or ch) as a TypeScriptnumber
https://marcus.se.net/obsidian-plugin-docs/api/interfaces/EditorPosition
https://github.com/marcusolsson/obsidian-plugin-docs/blob/main/obsidian.d.ts (line 871)
Edit: Here is the test file with the thousands of characters for your own testing
templater-cursor-example.md
The text was updated successfully, but these errors were encountered: