Feel-ix-343 / markdown-oxide

Editor Agnostic PKM: you bring the text editor and we bring the PKM - inspired by and compatible with Obsidian
GNU General Public License v3.0
684 stars 10 forks source link

[[filename]] link renaming error #124

Closed elgar328 closed 2 weeks ago

elgar328 commented 2 weeks ago

There are file1.md and file2.md files as shown below.

file1.md

# title1

[[file2]]

file2.md

# title1

If I open file1.md in helix editor and rename the [[file2]] link to [[aaa]], the expected behavior is as follows. file2.md --> aaa.md [[file2]] --> [[aaa]]

However, there is no change in the name of file2.md and the [[file2]] link, and the name of file1.md being edited is changed to aaa.md.

Feel-ix-343 commented 2 weeks ago

Hello!

In this case, the text [[file2]] is not referenceable, so renaming on that text will default to renaming the file that the cursor is in. This is the same as renaming on any blank space in the file, while renaming on a heading, which is referenceable, will rename that heading not the file. This is explained briefly in the readme.

In short, renaming on links doesn't work right now. If you want to rename a file, you must move your cursor to that file, find a place without any headings, and rename. It will then rename the file in the filesystem and in all of the links referencing it.

I think your use case is valid though, so I have opened an issue #126