Templater
Templater copied to clipboard
`tp.file.cursor` multi cursor not working when started from vim normal mode
Plugin information:
- OS: Kubuntu 16
- Templater version: 1.16
- Obsidian version: 1.0.3
Describe the bug
When using same order number as an argument for tp.file.cursor
, the multi cursor functionality does not work as expected:
- Use the command to navigate to the first cursor instance
- The first instance gets replaced by a first cursor as expected, but additional cursors are simply placed on the next lines under the the first cursor no matter where other
tp.file.cursor
instances are located.
Example:
The following template:
---
title: <% tp.file.cursor(1) %>
---
# <% tp.file.cursor(1) %>
Gives
---
title: Test
---Test
#
Additional context
- I also tried with simple spaced out lines without any front matter or headers to make sure nothing was interfering.
- I use the vim cursor feature.
Thanks for your time.
I didn't know about the multi-cursor functionality, that is so cool!
I just tried this in my vault and it worked as expected, using your exact template. Maybe there's another plugin conflicting? Have you tried in the sandbox vault with just the Templater plugin enabled?
I did not know about the sandbox feature, this is pretty helpful, thanks @Zachatoo .
As I suspected, the "vim keybindings" option interferes with the multi cursor functionality.
To be more specific, the bug occurs only when the "jump to next cursor location" command is executed in "vim normal mode", if I issue the command while in "vim insert mode", everything works as expected.
So I am going to edit the title, and let the developer decide if it is worth fixing.
I have the same issue! Since the problem seems to be with the vim keybindings I reported it on the Obsidian forum (https://forum.obsidian.md/t/vim-in-normal-mode-templater-multi-cursors-with-tp-file-cursor-1-not-placed-properly/52166) but they won't look at it because it involves a plugin.
This might be related to issue https://github.com/SilentVoid13/Templater/issues/1089