mo-seph / obsidian-note-from-template

Simple plugin to create Notes from a template, and fill in fields defined there
MIT License
107 stars 9 forks source link

[BUG] Even if nothing is selected, the plugin still links the new note #7

Closed Lulullia closed 2 years ago

Lulullia commented 2 years ago

It's as the title says, when I have a note open in edit mode, but with nothing selected, then run the plugin, it'll link the newly created note where my cursor was.

From what I understand, it should only do so when I had something selected and wanted to make a new note of it.

I'd like to keep the toggle in the settings on, for cases where I select stuff to be in the new template - maybe make separate options for this? One to decide if there should be a link regardless of the selection, and one if there should be a link when a selection was used.

PS: I've been playing around with your plugin a lot, it really has potential, that's why I'm opening quite a few issues ^^'

Lulullia commented 2 years ago

I just noticed that the commands don't work when in Preview mode! Since it's somewhat related to the original issue, I'm just putting it here. Is there any specific reason for this? It's not very convenient to work with unfortunately.

mo-seph commented 2 years ago

Agreed - this should be more sensible, and configurable! This has been bugging me too. I like the suggestion of different actions when text is selected or not.

mo-seph commented 2 years ago

I don't know about Preview mode, though - I didn't do anything special around it, so maybe it doesn't work as a normal editor. Something to look at!

mo-seph commented 2 years ago

New config should be working properly now template-should-replace can be set to always, never or sometimes (i.e. when text is selected)