Comments (9)
Should be resolved in 1.18.2!
from templater.
Thanks, I'll add some tests so I don't accidentally break this again in the future.
from templater.
Try pressing enter after inserting. I have line numbers enabled, and when I tested this behavior, I could see the line number change from line 1 to line 5, even though the cursor didn't move further down. If I press enter, the properties appear, without having to reopen. This might hold some clues as to how this can be resolved.
from templater.
I have one template where I'm getting similar results (live preview appears to not be refreshed/is not in sync with source mode unless you insert a newline after applying the template) but inconsistently ๐คจ ...
I mean, using 2 different templates doing the same thing (erasing completely the content of a note, Properties included) relying on 2 different Obsidian API methods, I get 2 different results:
The first one relies on app.workspace.activeEditor.editor ...
and for that one, I can also see the template working as expected, underneath, as like in FeralFlora's screen recording, the line number is refreshed (going from the initial line number 12
to 1
) but then I need to add a newline to effectively have live preview displaying the same result as in Source mode.
Here's a screen-recording illustrating that ๐ : Left side is the Testing
note opened in Source
and the right side is LP ๐ .
Testing.-.Source.vs.LP.mov
On the other hand, a template relying on app.vault.process ...
doesn't display such behavior ๐คทโโ๏ธ ... I.e.: no newline needed and both source and LP are in sync (displaying the same content) ...
Testing.-.Source.vs.LP.2.mov
I'm just mentioning this in case it could help ๐ ... as in both cases, 99% of the template uses Obsidian API only and I just thought this could potentially give some hint as to where the issue might be ๐ ...
from templater.
I am experiencing the same thing on some of my templates but I noticed the templates that are working make use of the tp.file.cursor, tp.file.move, or custom scripts. Attached is a video that shows how adding tp.file.cursor will trigger the properties to be shown.
ObsidianTemplaterBug1253.mov
from templater.
I believe this has been fixed again in 2.1.4
from templater.
tp.file.cursor
Can confirm for that one at least ๐ ...
I used a template adding properties to a note with a tp.file.cursor()
somewhere in it and didn't encountered the issue ๐คทโโ๏ธ ...
I mean, there didn't seem to have any delay between Source/Live Preview, everything was rendered at once and my cursor was placed where wanted...
I can only guess that tp.file.cursor()
somewhat replace manually adding a newline (while setting the focus on the specific note in Live Preview) ?
from templater.
With Templater 2.1.3 to avoid this behavior I needed to include this cursor command (as above) and enable option "Automatic jump to cursor".
from templater.
As @SedesGobhani said, the problem is back in version 2.1.3.
from templater.
Related Issues (20)
- Expand metadata in space - Geolocation coords support request HOT 3
- Console error: app.js:1 No file creator assigned to create file with extension com. Falling back to markdown file creator. HOT 1
- Error: Failed to List Templates, No Template Folder Configured HOT 8
- Execution of the tp.file.selection() function erase the selection in the note HOT 2
- Add note about modified date to the FAQs / docs
- front matter formating number as a string HOT 1
- main.js missing HOT 3
- Date not rendered as link HOT 1
- 2.3.2 broke my frontmatter processing template HOT 6
- Auto jump to cursor is triggered twice on new file creation HOT 4
- invalid reference date format, try specifying one with reference format HOT 4
- bug: app.workspace.getLeaf().openFile() replaces content in a note if called without "await"
- app.fileManager.processFrontMatter doesn't work HOT 1
- Templater should parse, merge and write out frontmatter gracefully HOT 6
- Applying Text Color in Obsidian Without Unwanted New Lines HOT 2
- Templater no longer works with console error "Plugin failure: templater-obsidian TypeError: c is not a constructor" HOT 2
- The recent upgrade of this plug-in has broken "Trigger Templater on new file creation" HOT 5
- {{date}} fail to work after updating to 2.3.3 HOT 1
- Target file gets overwritten by processFrontMatter() HOT 1
- Note Creation with Core Plugin "Note Composer" Breaks Templater HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from templater.