Code Monkey home page Code Monkey logo

Comments (9)

Zachatoo avatar Zachatoo commented on June 20, 2024 3

Should be resolved in 1.18.2!

from templater.

Zachatoo avatar Zachatoo commented on June 20, 2024 3

Thanks, I'll add some tests so I don't accidentally break this again in the future.

from templater.

FeralFlora avatar FeralFlora commented on June 20, 2024 2

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.

Obsidian_Ec13bZq38y

from templater.

I-Pch avatar I-Pch commented on June 20, 2024 1

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.

jcrum avatar jcrum commented on June 20, 2024 1

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.

Zachatoo avatar Zachatoo commented on June 20, 2024 1

I believe this has been fixed again in 2.1.4

from templater.

I-Pch avatar I-Pch commented on June 20, 2024

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.

SedesGobhani avatar SedesGobhani commented on June 20, 2024

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.

Comprehensive-Jason avatar Comprehensive-Jason commented on June 20, 2024

As @SedesGobhani said, the problem is back in version 2.1.3.

from templater.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.