-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: toggle intergrations #388
Comments
Hey, I guess it could but that's a bit out of scope of the plugin, I assume a simple autocmd would be enough to do it, yet nnp should still behave correctly |
I thought it didn't make much sense to have two integrations open on the same side.
Thanks for the pointer! I'll give it a try with an autocmd. Feel free to close if this does not belong in NNP. |
Its quite a bit of code to implement in user land, but this is what i have now. If anyone has suggestions for improvements, please let me know: vim.api.nvim_create_autocmd("FileType", {
pattern = {
"neo-tree",
"undotree",
"neotest-summary",
"dbui",
-- "dapui_*" TODO: turn when this is resolved: https://github.com/rcarriga/nvim-dap-ui/issues/329
"dapui_scopes",
},
callback = function()
if vim.bo.filetype == "neo-tree" then
pcall(vim.cmd.UndotreeHide)
pcall(vim.cmd.DBUIClose)
elseif vim.bo.filetype == "undotree" then
vim.cmd("Neotree close")
pcall(vim.cmd.DBUIClose)
-- fixes undotree width: https://github.com/mbbill/undotree/issues/143
vim.api.nvim_win_set_width(vim.api.nvim_get_current_win(), vim.g.undotree_SplitWidth)
elseif vim.bo.filetype == "dbui" then
vim.cmd("Neotree close")
pcall(vim.cmd.UndotreeHide)
-- fixes dap ui width
vim.api.nvim_win_set_width(vim.api.nvim_get_current_win(), vim.g.db_ui_winwidth)
elseif string.find(vim.bo.filetype, "^dapui") then
pcall(function()
vim.cmd("Neotest summary close")
end)
elseif vim.bo.filetype == "neotest-summary" then
-- TODO: this only works once because of https://github.com/rcarriga/nvim-dap-ui/issues/397
require("dapui").close()
end
end,
}) |
Describe the problem
Would it be possible for NNP to automatically close an integration when another one is opened on the same left/right position?
Describe the solution
integration
)integration
)The text was updated successfully, but these errors were encountered: