Bekaboo / dropbar.nvim

IDE-like breadcrumbs, out of the box
GNU General Public License v3.0
896 stars 17 forks source link

[Feature]: Lazy load even called `setup` #141

Closed ofseed closed 4 months ago

ofseed commented 4 months ago

Problem

Feel free to close this issue since it could easily be implemented by users and is not that essential

The readme claims that this plugin does not need lazy loading by users, but that's not the whole truth.

This plugin does not need setup to work due to the existence of plugin/dropbar.lua, and it is lazy loaded in this situation. But if the user just wants to customize it and calls require("dropbar").setup(opts), the plugin will be loaded immediately when nvim starts.

I tried to implement this by making setup only calls config.set and the original setup as a function to start dropbar. But I just realized that if require"dropbar" still loads all the modules, this will not make sense. So to implement it, rewriting or renaming a lot of modules may be unavoidable, I don't know whether you think it is worth doing that.

Expected behavior

lazy load dropbar even require"dropbar".setup() was called.