Closed jay-babu closed 1 year ago
breakpoints do show up when doing set_breakpoints, which actually resets the saved file:
manually calling this function seems to work: require("persistent-breakpoints.api").reload_breakpoints
using lazy.nvim
return {
"Weissle/persistent-breakpoints.nvim",
opts = function(_, opts)
return require("astronvim.utils").extend_tbl(opts, {
load_breakpoints_event = { "BufReadPost" },
})
end,
keys = {
{
"<leader>db",
function() require("persistent-breakpoints.api").toggle_breakpoint() end,
{ silent = true },
desc = "Toggle Breakpoint",
},
{
"<leader>dB",
function() require("persistent-breakpoints.api").clear_all_breakpoints() end,
{ silent = true },
desc = "Clear Breakpoints",
},
{
"<leader>dC",
function() require("persistent-breakpoints.api").set_conditional_breakpoint() end,
{ silent = true },
desc = "Conditional Breakpoint",
},
},
}
event = "BufReadPost",
was missing this to load the plugin
For LazyVim users:
{
"Weissle/persistent-breakpoints.nvim",
dependencies = {
{
"mfussenegger/nvim-dap",
keys = {
{ "<leader>db", false },
{ "<leader>dB", false },
},
},
},
event = "BufReadPost",
opts = {
save_dir = vim.fn.stdpath("data") .. "/nvim_checkpoints",
-- when to load the breakpoints? "BufReadPost" is recommanded.
load_breakpoints_event = "BufReadPost",
-- load_breakpoints_event = nil,
-- record the performance of different function. run :lua require('persistent-breakpoints.api').print_perf_data() to see the result.
perf_record = false,
-- perform callback when loading a persisted breakpoint
-- @param opts DAPBreakpointOptions options used to create the breakpoint ({condition, logMessage, hitCondition})
-- @param buf_id integer the buffer the breakpoint was set on
-- @param line integer the line the breakpoint was set on
on_load_breakpoint = nil,
},
keys = {
{
"<leader>db",
function()
require("persistent-breakpoints.api").toggle_breakpoint()
end,
silent = true,
desc = "Toggle-Breakpoint",
remap = false,
},
{
"<leader>dB",
function()
require("persistent-breakpoints.api").set_conditional_breakpoint()
end,
silent = true,
desc = "Conditional-Breakpoint",
remap = false,
},
},
}
-- after restarting neovim. no lines have a breakpoint visible
-- saved breakpoints