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: Win11
Templater version: 2.0.0 (fresh install on new vault)
Obsidian version: 1.5.2 (new vault)
Templater settings: Template folder location: "Templates/"; Automatic jump to cursor: TRUE; Template: "subscript.md" with contents <sub><% tp.file.selection() %><% tp.file.cursor(1) %></sub>; Hotkeys set-up: "Templates/subscript.md"; Hotkey: "Ctrl+," (replaced open settings)
Describe the bug
When I press Ctrl+, (set-up of the hotkey for subscript.md) it converts SELE to <sub>SELE<% tp.file.cursor(1) %</sub> if the hotkey is run inside of a table created by typing A|B enter -|- and adding a row with the plus-sign, typing a inside the first cell.
If I use my hotkey again, the cursor is gone as well as the unperformed <% tp.file.cursor(1) %>
If I use the hotkey again twice, the whole table row disappears
If I use it thrice, the table row appears again followed by, outside of the table, </sub> and next line </sub><br> | |. It may or may not display the initial selection
If I create the table below the first table using A|B enter -|- then the table is not created, but pressing enter with cursor at start of A|B does create the table. If I add a in the first cell and press the hotkey, the template is inserted with <br/> at the end. If I press the hotkey outside of the table next, it creates two cursors.
Expected behavior
Outside tables the hotkey works as expected, removing the tp command and teleporting the cursor. Inside tables, all kinds of unexpected things happen. Perhaps the Templater code is run after the table trying to repair itself with |? I don't understand what is happening but I'd expect the table cell to act as the hotkey does outside the table.
Screenshots
The text was updated successfully, but these errors were encountered:
It seems that <% tp.file.cursor() %> doesn't work in tables at all with the table update. I can manually type in a cursor and run the Jump to next cursor location command, and the template code will disappear but my cursor will not be in the table cell. If I try to type, nothing happens, my cursor is no longer in the editor.
I can add a line so the cursor executes, but it doesn't execute correctly, as explained above. Noting the change I made here.
asyncappend_template_to_active_file(template_file: TFile): Promise<void>{// ...const editor =active_editor.editor;constdoc=editor.getDoc();constoldSelections=doc.listSelections();doc.replaceSelection(output_content);awaitdelay(1);// added this line so cursor jumper logic finds cursor to jump to// ...}
Also not working for me after updating Obsidian to 1.5.3 and Templater to 2.0.0. I have no tables to deal with, but have to trigger the jump manually. EDIT: Forgot to add that the cursor jump is triggered correctly when I have it as a step in a QuickAdd macro. I hope that helps and doesn't complicate troubleshooting.
I'm also having this issue. I cannot jump out of tables using the cursor. It is quite annoying as my meeting template has several details recorded in table form.
Plugin information (please complete the following information):
<sub><% tp.file.selection() %><% tp.file.cursor(1) %></sub>
; Hotkeys set-up: "Templates/subscript.md"; Hotkey: "Ctrl+," (replaced open settings)Describe the bug
When I press Ctrl+, (set-up of the hotkey for subscript.md) it converts
SELE
to<sub>SELE<% tp.file.cursor(1) %</sub>
if the hotkey is run inside of a table created by typingA|B
enter-|-
and adding a row with the plus-sign, typinga
inside the first cell.<% tp.file.cursor(1) %>
</sub>
and next line</sub><br> | |
. It may or may not display the initial selectionIf I create the table below the first table using
A|B
enter-|-
then the table is not created, but pressing enter with cursor at start ofA|B
does create the table. If I adda
in the first cell and press the hotkey, the template is inserted with<br/>
at the end. If I press the hotkey outside of the table next, it creates two cursors.Expected behavior
Outside tables the hotkey works as expected, removing the tp command and teleporting the cursor. Inside tables, all kinds of unexpected things happen. Perhaps the Templater code is run after the table trying to repair itself with
|
? I don't understand what is happening but I'd expect the table cell to act as the hotkey does outside the table.Screenshots
![image](https://private-user-images.githubusercontent.com/4662406/290649591-0bc24db4-beeb-41ac-a32f-0dca08441cdc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAzOTU2MjksIm5iZiI6MTcyMDM5NTMyOSwicGF0aCI6Ii80NjYyNDA2LzI5MDY0OTU5MS0wYmMyNGRiNC1iZWViLTQxYWMtYTMyZi0wZGNhMDg0NDFjZGMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MDdUMjMzNTI5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDliMTM5OTlmNWIxZjQzMzVkYmY3YTc0Zjc1YjdhOTA1ODg2MWE2ZjkwZTRhNDlhYTVkNjJlN2Y5ZjI3YTg2NiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.-8dUUNgrahqdznQb_CStait1u1hv-Qe94Ud08AGMtXk)
The text was updated successfully, but these errors were encountered: