Closed qawatake closed 2 years ago
This looks like the expected behavior to me. The zettlekasten prefixer plugin allows you to also provide a descriptive name for your file. So the filename field should stay focused to allow you to add your note title (e.g. 202203130901 my note
). When you press Enter your cursor will be at the location of tp.file.cursor()
.
@liamcain
Thank you for your reply! I see. I have checked the changelog and found https://github.com/SilentVoid13/Templater/blob/master/CHANGELOG.md#bug-fixes.
By the way, is it possible to make these options selectable? I would like to have the cursor immediately go to the text, as it was originally supposed to do.
I don't think that behavior was ever the intention of the cursor jump, so I'd rather not add it back even as an option. In my opinion, it was only a bug. However, if you've gotten used to the behavior and would like to recreate it, I recommend adding the following to the top of your template:
<%* app.workspace.activeLeaf.view.editor.focus() -%>
That will immediately cause the file to get focused on creation, which will be the same behavior you were seeing with the cursor jump previously.
All right, I will try to get used to the new behavior. (By the way, using the workaround you gave me, the cursor does not seem to be at the exact position I specified.)
(By the way, using the workaround you gave me, the cursor does not seem to be at the exact position I specified.)
Strange, I tested with this template and it worked as expected for me.
<%* app.workspace.activeLeaf.view.editor.focus() -%>
aasdfasdftesting
# <% tp.file.cursor() %>
---
testing, cursor should be above this
@liamcain
Sorry, I made a mistake. Your code works perfectly! Thank you very much!
Plugin informations (please complete the following information):
Trigger Templater on new file creation
andAutomatic jump to cursor
are enabled. The others are default.Describe the bug I create a zettelkasten note by the core zettelkasten plugin with the following template:
After creating a note, the cursor is on the file name field.
Expected behavior After creating a zettelkasten note, the cursor should be inserted after
#
.Screenshots
Additional context Updating the version caused this bug. Version 1.9.x did not have this bug.