Only register adapters for each feature when enable = true #46
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
barrettruth/canola-collection#46
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
All the adapters are registered nonlazily here:
github.com/barrettruth/canola-collection@65aa1c4f72/plugin/canola-collection.lua (L6-L14)The five calls of
register_adapterresult in a startup performance penalty of ~14ms on my machine. This is pretty small, but it makes canola-collection a relatively heavy plugin for me, which I think can be avoided.Instead of always registering an adapter, an
enablefield could be added to each of the canola-collection config tables. There's already one forcanola-git, just not the others. This would lower the startup penalty for most users, who likely just want trash or git support.just saw this. addressing today.
The extensions are now conditionally enabled based on the existence of the config variable (
{}is truthy).vim.g.canola_git.enabledhas been removed.If you do not want the plugin enabled, then don't set the corresponding
vim.g.canola_<extension>.Secondly, I'm removing
vim.g.canola.delete.trashin favor ofvim.g.canola_trash. Honestly, no idea why I even did that... smh. It'll be done in the next 10 minutesIn other words, I'm pretty sure that you use trash - update your config!
Sorry for these breaking changes - however, I'm taking advantage of them while I have them (before general release) ;)
No worries - happy to find issues before others would. Can confirm that
register_adapteris now only being called once in my logs, and trash support is working well with the truthy{}.