diff --git a/init.lua b/init.lua index 80f0170..1b2e21d 100644 --- a/init.lua +++ b/init.lua @@ -117,61 +117,61 @@ require("lazy").setup({ vim.g.molten_output_win_max_height = 12 end, }, - { - 'rmagatti/auto-session', - lazy = false, - opts = { - save_extra_data = function(_) - local ok, breakpoints = pcall(require, "dap.breakpoints") - if not ok or not breakpoints then - return - end - - local bps = {} - local breakpoints_by_buf = breakpoints.get() - for buf, buf_bps in pairs(breakpoints_by_buf) do - bps[vim.api.nvim_buf_get_name(buf)] = buf_bps - end - if vim.tbl_isempty(bps) then - return - end - local extra_data = { - breakpoints = bps, - } - return vim.fn.json_encode(extra_data) - end, - - restore_extra_data = function(_, extra_data) - local json = vim.fn.json_decode(extra_data) - - if json.breakpoints then - local ok, breakpoints = pcall(require, "dap.breakpoints") - - if not ok or not breakpoints then - return - end - vim.notify("restoring breakpoints") - for buf_name, buf_bps in pairs(json.breakpoints) do - for _, bp in pairs(buf_bps) do - local line = bp.line - local opts = { - condition = bp.condition, - log_message = bp.logMessage, - hit_condition = bp.hitCondition, - } - - local bufnr = vim.fn.bufnr(buf_name, true) - if vim.fn.bufloaded(bufnr) == 0 then - vim.api.nvim_buf_call(bufnr, vim.cmd.edit) - end - - breakpoints.set(opts, bufnr, line) - end - end - end - end, - } - }, + -- { + -- 'rmagatti/auto-session', + -- lazy = false, + -- opts = { + -- save_extra_data = function(_) + -- local ok, breakpoints = pcall(require, "dap.breakpoints") + -- if not ok or not breakpoints then + -- return + -- end + -- + -- local bps = {} + -- local breakpoints_by_buf = breakpoints.get() + -- for buf, buf_bps in pairs(breakpoints_by_buf) do + -- bps[vim.api.nvim_buf_get_name(buf)] = buf_bps + -- end + -- if vim.tbl_isempty(bps) then + -- return + -- end + -- local extra_data = { + -- breakpoints = bps, + -- } + -- return vim.fn.json_encode(extra_data) + -- end, + -- + -- restore_extra_data = function(_, extra_data) + -- local json = vim.fn.json_decode(extra_data) + -- + -- if json.breakpoints then + -- local ok, breakpoints = pcall(require, "dap.breakpoints") + -- + -- if not ok or not breakpoints then + -- return + -- end + -- vim.notify("restoring breakpoints") + -- for buf_name, buf_bps in pairs(json.breakpoints) do + -- for _, bp in pairs(buf_bps) do + -- local line = bp.line + -- local opts = { + -- condition = bp.condition, + -- log_message = bp.logMessage, + -- hit_condition = bp.hitCondition, + -- } + -- + -- local bufnr = vim.fn.bufnr(buf_name, true) + -- if vim.fn.bufloaded(bufnr) == 0 then + -- vim.api.nvim_buf_call(bufnr, vim.cmd.edit) + -- end + -- + -- breakpoints.set(opts, bufnr, line) + -- end + -- end + -- end + -- end, + -- } + -- }, { "williamboman/mason.nvim", opts = {}