Skip to content

Commit

Permalink
another fix for resolve_note
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh committed Nov 10, 2023
1 parent a73b143 commit ad05dbc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/obsidian/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,8 @@ Client.resolve_note = function(self, query)

local query_lwr = string.lower(query)
local maybe_matches = {}
for _, note in ipairs(self:search(query, { "--ignore-case" })) do
for _, res in ipairs(self:search(query, { "--ignore-case" })) do
local note = res[1]
if query == note.id or query == note:display_name() or util.contains(note.aliases, query) then
-- Exact match! We're done!
return note
Expand Down
2 changes: 2 additions & 0 deletions lua/obsidian/command.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ command.open = function(client, data)
echo.err("couldn't find an Obsidian vault", client.opts.log_level)
return
end

local vault_name = vim.fs.basename(vault)
assert(vault_name)

local path
if data.args:len() > 0 then
Expand Down

0 comments on commit ad05dbc

Please sign in to comment.