Open spiritualgeek opened 9 months ago
That does sound dangerous. I would rather just trigger a shortcut than have this be done automatically
I have just end my vocation, and I will take a look at this problem.
Hi @spiritualgeek, I will explain how rename operation working.
Suppose you have a note with name {fixed-prefix}
and your setting is path = ${notepath}/${notename}, name = ${notename}-${date}
, if your pasted a image file to the note {fixed-prefix}
, the plugin will try to create a foler with ${notepath}/${notename}
(we suppose the ${notepath} is empty and the folder was named with {fixed-prefix}
). The folder {fixed-prefix}
will have a attachment file {fixed-prefix}-${date}
.
When you rename the note file {fixed-prefix}
to {fixed-prefix}-
, this plugin will calucate the attachemnt path with the old note name ({fixed-prefix}
) and new name ({fixed-prefix}-
). The result will be {fixed-prefix}
and {fixed-prefix}-
, then it rename the attachment folder from {fixed-prefix}
to {fixed-prefix}-
.
Af that, the plugin will traverse the new attachment folder {fixed-prefix}-
and process each file, if the extension was satisfied, replace the {fixed-prefix}
in the file name to {fixed-prefix}-
directly.
This will leading some problem if you already have some file in the attachemnt file that filename contain the {fixed-prefix}
but thery are not relate with the note. They will also be renamed.
The most important thing I want to say is, for the rename operation, the note was associate with the attachment folder. It not care about wherever the file in attachment folder was linked in the note. And this is for simple reason when I develop this plugin.
This will happen, on the odd occasion, when I'm still thinking what to name the {variable-suffix} portion and the note is saved
The advise is, not to create a note with name {fixed-prefix}-
, you can write whatever in the {variable-suffix}
and rename it when you think out.
Thank you for the detailed reply. It's an edge case that I will be careful with for now
Was creating a new note in a folder
Within the folder I have an attachments folder
As I created the new note, all files were prefixed with the new note name?
This is a serious bug :/
Edit:
I know how this happens
My notes follow a strict naming methodology per folder
{fixed-prefix}-{variable-suffix}
If I create a note with the name
{fixed-prefix}-
and save, the plugin will go out and find all files starting with that and proceed to rename without considering which note is actually being editedThis will happen, on the odd occasion, when I'm still thinking what to name the
{variable-suffix}
portion and the note is savedCan you please look into this?
Thanks