Skip to content

Commit

Permalink
Handle multiple choices
Browse files Browse the repository at this point in the history
  • Loading branch information
xulongwu4 committed Oct 19, 2024
1 parent 9a75cd3 commit b071178
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lua/obsidian/commands/titles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ local function convert_notes_to_picker_entries(notes)
entries[#entries + 1] = {
value = note,
display = title,
ordinal = note:display_name(),
ordinal = note:display_name() .. " " .. title,
filename = tostring(note.path),
}
end
Expand All @@ -25,7 +25,7 @@ local function convert_notes_to_picker_entries(notes)
entries[#entries + 1] = {
value = note,
display = alias,
ordinal = note:display_name(),
ordinal = note:display_name() .. " " .. alias,
filename = tostring(note.path),
}
end
Expand All @@ -47,8 +47,10 @@ return function(client)
vim.schedule(function()
picker:pick(convert_notes_to_picker_entries(notes), {
prompt_title = "Titles",
callback = function(note)
util.open_buffer(note.path)
callback = function(...)
for _, note in ipairs { ... } do
util.open_buffer(note.path)
end
end,
allow_multiple = true,
})
Expand Down

0 comments on commit b071178

Please sign in to comment.