All `cmd` does not work in `Diffview`
Hi,
When working in Diffview I would like to be able to resize / enable auto resizing of the differents windows (diff files) except the Diffview panel.
Actually when I open Diffview, all the cmd (like FocusEnable FocusAutoresize or FocusMaximise) are not working.
How can I proceed so the Diffview panel is not resized but the diff files are ?
Actual config :
{
"nvim-focus/focus.nvim",
event = "VeryLazy",
opts = {
enable = true,
commands = true,
split = {
bufnew = false,
tmux = false,
},
autoresize = {
enable = true,
width = 0,
height = 0,
minwidth = 0,
minheight = 0,
height_quickfix = 10,
},
ui = {
number = false,
relativenumber = false,
hybridnumber = false,
absolutenumber_unfocussed = false,
cursorline = false,
cursorcolumn = false,
colorcolumn = {
enable = false,
},
signcolumn = false,
winhighlight = false,
},
},
}
Autocmds related :
{
"WinEnter",
function()
local ignore_buftypes = { "nofile", "prompt", "popup" }
if vim.tbl_contains(ignore_buftypes, vim.bo.buftype) then
vim.b.focus_disable = true
end
end,
description = "Disable focus autoresize for BufType",
},
{
"FileType",
function()
local ignore_filetypes = {
["neo-tree"] = true,
["dap-repl"] = true,
SidebarNvim = true,
Trouble = true,
terminal = true,
dapui_console = true,
dapui_watches = true,
dapui_stacks = true,
dapui_breakpoints = true,
dapui_scopes = true,
OverseerList = true,
noice = true,
DiffviewFiles = true,
}
vim.b.focus_disable = ignore_filetypes[vim.bo.filetype]
end,
description = "Disable focus autoresize for FileType",
},
You recognize that you disabled focus for DiffviewFiles?
You recognize that you disabled focus for DiffviewFiles?
@cryptomilk
Of course, in Diffview, the left panel has a filetype of Diffviewfiles but other splits are not of that filetype. (They can be lua, ts etc..).
So, the commands should work for the other splits right ?
And when enabling focus for DiffviewFiles, I have the Diffview pane being resized on focus, and not the others panes.
For example, with Overseer (which I disabled too), the pane of Overseer is not changed by focus, but if I have splits opened the splits are being changed by focus
@cryptomilk
Please see the behavior with Overseer and then with Diffview
https://github.com/nvim-focus/focus.nvim/assets/58638832/cd025723-ef32-44bf-9ad0-6277d8549e76
So, can I achieve the same behavior focus has with Overseer for Diffview
And can the probleme be related to Diffview opening a new tab while Overseer don't ?
a) You can disable it for windows, buffers or globally. See :help windows.
b) I don't know what you mean, there a config for reproducing things here: https://github.com/nvim-focus/focus.nvim/tree/master/extras Use it and explain how to t reproduce the behavior with it.
Could it be caused by this https://github.com/nvim-focus/focus.nvim/blob/5500e1a9e926eec5a361d910679282fd723c0a96/lua/focus/modules/resizer.lua#L120 line?
Try to remove it and see :-)
The question was directed @ls-devs.
@pkwiek Want to create a PR to remove that line?