Skip to content

Commit

Permalink
Allow :ObsidianRename to move files
Browse files Browse the repository at this point in the history
  • Loading branch information
Wasabi375 committed Oct 6, 2024
1 parent 14e0427 commit 17f832a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
4 changes: 2 additions & 2 deletions lua/obsidian/commands/rename.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 17f832a

Please sign in to comment.