windows.nvim
windows.nvim copied to clipboard
Autowidth is troublesome with plugins like diffview
Some plugins do not necessarily create entire filetypes or buftypes, making it difficult to accurately pinpoint situations where we don't want the plugin to change that. Such example is easily seen with diffview.
I know this doesn't really solve the underlying issue but I think specifying a custom filetype is good practice for plugins and the author of diffview should also add this.
I'm bodging my way around this specific issue with:
function DiffviewToggle()
local lib = require("diffview.lib")
local view = lib.get_current_view()
if view then
-- Current tabpage is a Diffview; close it
vim.cmd(":DiffviewClose")
vim.cmd(":WindowsEnableAutowidth")
else
-- No open Diffview exists: open a new one
vim.cmd(":WindowsDisableAutowidth")
vim.cmd(":DiffviewOpen")
end
end
map("n", "<leader>df", ":lua DiffviewToggle()<CR>")
I get a similar issue with toggleterm :|
nvim
freaks out
great plugin though
I'm also experiencing problems with toggleterm. It's a really cool plugin so I hope this gets fixed.
I will, but now I'm busy