lite-plugins icon indicating copy to clipboard operation
lite-plugins copied to clipboard

Add toggle support for plugins

Open stefanos82 opened this issue 5 years ago • 3 comments

I like how drawwhitespace.lua works, but I would like to enable it via toggle option when I need to.

I'm sure many more plugins need this feature.

Is it something it could be added easily?

stefanos82 avatar May 19 '20 12:05 stefanos82

It is not, once a plugin is loaded it can't be unloaded for the rest of the session. This is an intentional decision made for the purpose of keeping plugins simple to write -- they can hook into whatever they want and don't need to worry about cleaning up after themselves.

One thing that can be done for plugins where you want to toggle functionality is to implement it directly into the plugin, see the hidestatus plugin, for example. I'm unsure the drawwhitespace plugin would benefit from this, though, for what reason are you wanting to frequently toggle it on and off?

rxi avatar May 19 '20 12:05 rxi

You misunderstood me @rxi.

Indeed what I want is exactly what hidestatus.lua does or should I say implements.

image

Well, as you can see, the code is not clear enough with all these dots; I want it to get clearer and enable this output only when I'm investigating for tabs versus spaces characters.

I'm new to Lua and I will need some time to experiment until I feel confident enough to start working on new features or bug fixes.

I'm basically trying to bring Lite to a level closer to Vim and VSCode combined.

I'm sure others would want to achieve the same as well.

stefanos82 avatar May 19 '20 13:05 stefanos82

I'm basically trying to bring Lite to a level closer to Vim and VSCode combined.

And ST :P I believe lite can become a very nice open source competitor to Sublime.
Togglable plugins would be a great step towards that.

Tmpod avatar Jun 10 '20 00:06 Tmpod