-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Overlays, example overlay plugins #3733
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
base: master
Are you sure you want to change the base?
Conversation
Thanks for taking the initiative on this one! I tried it with a tiny test plugin that draws an overlay and allows moving it around with arrow keys1 and it seems to work pretty well. I like the API for registering an overlay and drawing, it's easy enough to get started quickly. I will definitely use this in µlsp for showing hover information and menus for taking code actions / jumping to results of find symbol if/when this gets merged. Event handling seems to be a bit clunky when you want to do more advanced stuff like type into the overlay – in that use case it would be nice to have something that works like a hidden bufpane which handles all events while the overlay is visible (so you don't need to handle and ignore all possible events to emulate capturing focus). Some criticism:
Footnotes |
I am trying to make my first plugin, and I had in my plans to create a simple settings menu for my plugin. It seemed to work, although when triggering actions the bp does not show its "real state" To create text boxes maybe would be nice to add a softwrap flag? |
Literally reading my mind. I actually started working on something like this, but ended up scrapping it because it was getting a bit complicated, and I didn't want to make this PR too big to get accepted. But hopefully we can get something like it implemented in the future, it would be very nice for more advanced use cases (like @usfbih8u mentioned in the tooltip issue).
Embarrassing! I'll have to get that fixed.
Yeah, I noticed this too - not sure what to do about it, though. There is an old PR (#2632) that adds a It might also be okay to let the plugin optionally control where the cursor is drawn? Dunno. Could use some suggestions here.
Yep, it's kinda bad - the saving grace is that the syntax is the same as micro's theme syntax, so it's not completely arbitrary, but I agree that it is weird.
Nice, I just tried that and it's much better. Just
We are this close to having micro be a game engine, just like emacs :D
I didn't have time to check it out yet, but at a glance, I don't see anything obviously wrong with your code. One thing that comes to mind is that, since overlays are rendered after everything else, any changes you make to micro's state won't be reflected until the next screen update. You can force a screen update by calling
Yes! Actually, I initially implemented |
Implemented more or less the way I described here.
Some notes:
quickmenu
plugin.I'm hoping plugin authors can also weigh in and give some feedback!