mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-11-08 08:05:58 +01:00
dapui: lazy load
This commit is contained in:
parent
edab575b52
commit
0608e107cd
1 changed files with 21 additions and 12 deletions
|
@ -6,7 +6,7 @@
|
|||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.attrsets) mapAttrs;
|
||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding;
|
||||
inherit (lib.nvim.binds) addDescriptionsToMappings mkSetLuaBinding mkSetLuaLznBinding;
|
||||
inherit (lib.nvim.dag) entryAnywhere entryAfter;
|
||||
|
||||
cfg = config.vim.debugger.nvim-dap;
|
||||
|
@ -49,24 +49,33 @@ in {
|
|||
];
|
||||
})
|
||||
(mkIf (cfg.enable && cfg.ui.enable) {
|
||||
vim.startPlugins = ["nvim-dap-ui" "nvim-nio"];
|
||||
vim.startPlugins = ["nvim-nio"];
|
||||
|
||||
vim.pluginRC.nvim-dap-ui = entryAfter ["nvim-dap"] (''
|
||||
local dapui = require("dapui")
|
||||
dapui.setup()
|
||||
''
|
||||
+ optionalString cfg.ui.autoStart ''
|
||||
vim.lazy.plugins = [
|
||||
{
|
||||
package = "nvim-dap-ui";
|
||||
setupModule = "dapui";
|
||||
setupOpts = {};
|
||||
|
||||
keys = [
|
||||
(mkSetLuaLznBinding mappings.toggleDapUI "function() require('dapui').toggle() end")
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
vim.pluginRC.nvim-dap-ui = entryAfter ["nvim-dap"] (
|
||||
optionalString cfg.ui.autoStart ''
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
dapui.open()
|
||||
require("dapui").open()
|
||||
end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
dapui.close()
|
||||
require("dapui").close()
|
||||
end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
dapui.close()
|
||||
require("dapui").close()
|
||||
end
|
||||
'');
|
||||
vim.maps.normal = mkSetLuaBinding mappings.toggleDapUI "require('dapui').toggle";
|
||||
''
|
||||
);
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue