Bekaboo / dropbar.nvim

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

feat(menu): allow showing virtual text below entries #92

Closed willothy closed 1 year ago

willothy commented 1 year ago

This PR adds the ability to show virt_text below each menu entry:

https://github.com/Bekaboo/dropbar.nvim/assets/38540736/b8d0523d-484e-45f7-8572-aab9e48afea1

Bekaboo commented 1 year ago

@willothy Thanks but the videos seems to be a demo of overseer.nvim instead of this plugin? Sorry I don't get the point of this PR, could you explain it further?

willothy commented 1 year ago

The demo is of the custom ui.select menu I made based on the dropbar menu. This PR adds the ability for each menu entry to (optionally) display a line of virtual text below it. This can be useful for providing extra info for each entry without extending the lines, and since it's virtual text the cursor will skip over it and still only highlight each entry.

The virtual text in the demo is the explanations of each command - you can see it is highlighted as Comment and is skipped over by the cursor.

By default this PR does nothing to change the winbar or dropdown menus, but it provides the virt text as an extension to the current API so that it can be used when creating other kinds of menus.

Bekaboo commented 1 year ago

Could we use Pascal case for the virtualtext namespace?

willothy commented 1 year ago

Updated branch and changed the namespace id :)

willothy commented 1 year ago

Awesome! Is the ui-select menu something you'd want to integrate into the plugin, or should I just keep that for my own config?

Bekaboo commented 1 year ago

@willothy It would be greate if you can help integrating ui-select into this plugin :D

willothy commented 1 year ago

@willothy It would be greate if you can help integrating ui-select into this plugin :D

Sounds good! My current implementation works but contains a few hacky things for my config, I'll clean it up and open a PR :)