From 17f832afd433e69f8bea80e376fb31cf4031754f Mon Sep 17 00:00:00 2001 From: Burkhard Mittelbach Date: Sun, 6 Oct 2024 15:32:50 +0200 Subject: [PATCH] Allow :ObsidianRename to move files fixes: #742 --- CHANGELOG.md | 1 + lua/obsidian/commands/rename.lua | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b585ed0e2..ea67370cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- `ObsidianRename` can be used to move notes. - Fixed an edge case with collecting backlinks. - Fixed typo in `ObsidianPasteImg`'s command description - Fixed the case when `opts.attachments` is `nil`. diff --git a/lua/obsidian/commands/rename.lua b/lua/obsidian/commands/rename.lua index b356d971d..72213d6e1 100644 --- a/lua/obsidian/commands/rename.lua +++ b/lua/obsidian/commands/rename.lua @@ -97,8 +97,8 @@ return function(client, data) new_note_path = (dirname / new_note_id):with_suffix ".md" end - if new_note_id == cur_note_id then - log.warn "New note ID is the same, doing nothing" + if new_note_path == cur_note_path then + log.warn "New note ID and path are unchanged, doing nothing" return end