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

ignore doesn't work for folke/snacks explorer #172

Open
domenicouni opened this issue Mar 5, 2025 · 1 comment
Open

ignore doesn't work for folke/snacks explorer #172

domenicouni opened this issue Mar 5, 2025 · 1 comment

Comments

@domenicouni
Copy link

domenicouni commented Mar 5, 2025

In order to reproduce the issue:

1. Install the plugin
2. Install folke/snacks.nvim
3. Run `Snacks.explorer()`

Current config, as taken from the docs, works fine with neo-tree:

local ignore_filetypes = {
  "neo-tree",
  "neo-tree-popup",
  "notify",
  "TelescopePrompt",
  "snacks_picker_list",
  "snacks_picker_input",
}


vim.api.nvim_create_autocmd("FileType", {
  group = augroup,
  callback = function(_)
    if vim.tbl_contains(ignore_filetypes, vim.bo.filetype) then
      vim.b.focus_disable = true
    else
      vim.b.focus_disable = false
    end
  end,
  desc = "Disable focus autoresize for FileType",
})
@cryptomilk
Copy link
Collaborator

cryptomilk commented Mar 5, 2025

I guess the difference is that how the window is created.

Try :lua vim.api.nvim_open_win(0, false, { split = 'left', win = 0 }) and then try again and change true to false. Do you see the difference?

The best is to open a new window, set all the options you want like winwidth, buftype and filetype and then focus it. I guess that snacks does directly focus the window before setting buffer type and file type so focus.nvim triggers already before you can disable 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