-
Notifications
You must be signed in to change notification settings - Fork 85
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: disable auto-setup #438
Conversation
|
I don't like that users might need to add an additional line of code outside their packages config just for us. Don't we have another way to fix this? The issue is that we'd want to run after lazy's |
There's a few things going on here, which could happen with any plugin manager (not just lazy):
I'm attempting to solve all three problems with
I thought about that, but unfortunately, no. Here is a collection of valid lazy configs to illustrate (but again, you could reproduce this with packer as well): {'romgrk/barbar.nvim', event = 'BufEnter', config = true} -- works with VimEnter
{'romgrk/barbar.nvim', event = 'BufEnter', config = false} -- broken with VimEnter
{'romgrk/barbar.nvim', lazy = false} -- works with VimEnter
{'romgrk/barbar.nvim', lazy = true} -- sometimes works with VimEnter Additionally, my own setup only sometimes works with the This is kind of a halting problem: how can we guarantee, from the context of Of course, we could grep the user's
A couple things about this:
require('lazy').setup {
{'romgrk/barbar.nvim',
dependencies = 'nvim-tree/nvim-web-devicons',
init = function() vim.g.barbar_setup = true end, -- ← here
opts = {animation = true, insert_at_start = true, --[[…etc]]},
version = '^1.0.0',
},
}
See the modified README in this PR for in-context examples. FWIW I agree with you, I wish there was a better way (but there's nothing I can see). Issues like these are why I think we should do away with auto-setup in v2: we're back to |
@lucassperez I changed it to |
The root cause of all this is of course that some idiot decided that adding a Anyway, this is temporary until we migrate away from |
Ideally I'd like if we'd stop migrating & breaking stuff like this for a while, plan everything we want to break, and break everything at once so users only have to worry about us once and then they're off the hook with our changes. |
We'll have to keep it if we keep auto-setup, unfortunately. If we require users to call |
I'm fine requiring users to call setup. Not because it's a good option, but simply because many other plugins do it so we should just follow the trend to give our users a consistent UX with other plugins. I hate that neovim devs didn't create stronger standards when they had the chance to. |
We should definitely discuss the items in #394 at some point. Edit:
Alright, I'll tick it on the v2 changes list. |
Well, I hate this PR but you can merge it, there is no better option and it patches the issue for now. |
My apologies 🙏 |
This is the most minimal look I could achieve with barbar. Such minimal look was impossible with lualine. Explanation of the configuration as it is now: - `barbar_auto_setup = false` and using `config` instead of `opts` is because this is the only way how to disable icons and not get an error. for more info, see: romgrk/barbar.nvim#438 - I did not find a better way to specify the colors (that is unrelated to the previous point) - the empty string in `separator.left` must be there, otherwise, if this value is empty, the tabs jump when cycling through them - to focus the tab on the right when closing a tab is what feels the most natural to me - inserting a new tab at the end is also what feels the most natural - maximum_padding set to 0 instead of 1 seems to change nothing. this makes me uncertain if 0 is a valid value. I am therefore setting it to "1".
This is the most minimal look I could achieve with barbar. Such minimal look was impossible with lualine. Explanation of the configuration as it is now: - `barbar_auto_setup = false` and using `config` instead of `opts` is because this is the only way how to disable icons and not get an error. for more info, see: romgrk/barbar.nvim#438 - I did not find a better way to specify the colors (that is unrelated to the previous point) - the empty string in `separator.left` must be there, otherwise, if this value is empty, the tabs jump when cycling through them - to focus the tab on the right when closing a tab is what feels the most natural to me - inserting a new tab at the end is also what feels the most natural - maximum_padding set to 0 instead of 1 seems to change nothing. this makes me uncertain if 0 is a valid value. I am therefore setting it to "1".
Enables users to disable the auto-setup in
plugin/barbar.lua
. All you have to do is:Closes #431