1
0

Notify about addition and deletion of bookmarks

This commit is contained in:
Stefan Rakel
2025-10-30 15:45:28 +01:00
parent 15a9a1c4ce
commit 344de7e714

View File

@@ -69,6 +69,7 @@ function M.addBookmark()
local file = vim.api.nvim_buf_get_name(0) local file = vim.api.nvim_buf_get_name(0)
local cursor = vim.api.nvim_win_get_cursor(0) local cursor = vim.api.nvim_win_get_cursor(0)
table.insert(bookmarks, {name = input, file = file, cursor = cursor}) table.insert(bookmarks, {name = input, file = file, cursor = cursor})
vim.notify("Bookmark \"" .. input .. "\" added")
end end
end) end)
end end
@@ -82,9 +83,10 @@ function M.selectBookmark(action, on_choice)
end end
function M.deleteBookmark() function M.deleteBookmark()
M.selectBookmark("Delete", function(_, idx) M.selectBookmark("Delete", function(bookmark, idx)
if idx then if idx then
table.remove(bookmarks, idx) table.remove(bookmarks, idx)
vim.notify("Deleted bookmark \"".. bookmark.name .. "\"")
end end
end) end)
end end