Cursor Position not working in snippet

I am trying to enhance the default task snippet/template by adding some attributes to it, so I have modified the task snippet as follows:

$1* [ ] |^| [creationDate: {{today}}]

I am hoping that when I type /task it will insert as below

* [ ]  [creationDate: 2024-02-23]
      ^ ... and put the cursor here...

however when I add this it comes out as this instead:

* [ ] |^| [creationDate: 2024-02-23]
<- Cursor goes to new line

So I am not sure what I am missing here…

Thanks in advance!

#syntax help-wanted #template #snippet

Hmm. It’s possible that the cursor placement thing doesn’t work with regex matches yet. I’d have to check.

Ok, this was a bit more involved than I anticipated but I just merged an implementation of this and used your example in the docs. Will be part of the next release, and will be on edge in a few minutes.

I just updated to 0.7.3 and this is now working as expected! Thanks for looking into it, loving the app so far, trying to figure out my workflow/get more familiar with the app but I hope to really dive into the code here soon!

1 Like