-
Notifications
You must be signed in to change notification settings - Fork 55
Mouse click support for winbar #280
Comments
I could implement it now but in all honesty it would be very messy and I'm not quite sure how I'd manage to integrate it properly with how Feline currently generates a statusline. I plan to make a PR to Neovim in the future that allows using Lua callbacks and tables to configure the statusline. So I was originally planning on finishing that first and then adding click support to Feline. Though, if really needed, I could give a shot at implementing it now, but there will be lots of gotchas and limitations (e.g.: You may not be able to have more than 50 clickable items in a statusline due to a (Neo-)Vim limitation). |
No worries! I'm in no rush, was just seeing if there was anything available yet. Thanks for the status update! |
Let's keep this open until the feature is implemented |
Do not follow the tips in this comment. It was experimental and might be removed later.Until Neovim supports lua callback for statusline clicks, if you have local core = require("nui.bar.core")
local function on_click(_, click_count, mouse_button, modifiers, ctx)
print(ctx.tabid, ctx.winid, ctx.bufnr, ctx.is_focused)
print(ctx.ctx.hello)
end
-- then make provider for feline
local clickable_provider = core.clickable("CLICK ME", {
context = { hello = "world" },
on_click = on_click,
}) |
Neovim already supports lua statusline click callbacks through |
Ah, global and module functions are of course supported (as soon as Famiu landed that click support). 😂 What I shared is just a convenient wrapper around that feature that generates the statusline format string for clicking. |
Cool, yeah seems useful👍🏻 The way you phrased it seemed like you were waiting for some kind of support in Neovim. I'm not sure if it can be made more convenient in core. EDIT: I guess you were referencing what famiu said above |
Yeah, should've mentioned I was referencing to the discussion above 😃 |
Hey I just have a quick question, I saw your Neovim improvement to add click support to winbar @famiu ! Very impressive work and I'm really excited to give it a try. I was just wondering if any of that functionality has made it to feline yet.
Thanks so much for all your Neovim work!
The text was updated successfully, but these errors were encountered: