Skip to content
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

All cmd does not work in Diffview #147

Open
ls-devs opened this issue Feb 19, 2024 · 4 comments
Open

All cmd does not work in Diffview #147

ls-devs opened this issue Feb 19, 2024 · 4 comments

Comments

@ls-devs
Copy link

ls-devs commented Feb 19, 2024

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",
				},
@cryptomilk
Copy link
Collaborator

You recognize that you disabled focus for DiffviewFiles?

@ls-devs
Copy link
Author

ls-devs commented Feb 21, 2024

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

@ls-devs
Copy link
Author

ls-devs commented Feb 21, 2024

@cryptomilk

Please see the behavior with Overseer and then with Diffview

diff.mp4

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 ?

@cryptomilk
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants