zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
25.26k stars 1.18k forks source link

Feature proposal: TUI drop-down menus #3399

Open carbon-starlight opened 4 months ago

carbon-starlight commented 4 months ago

Micro, in my opinion, is probably the best TUI editor for beginners. It, however, lacks one very useful feature that was present in mc, mcedit and some other apps and does help beginners a lot: drop-down menus.

mcedit example:

image

In edit editor:

image

Inspired by these designs I propose to implement similar functional. Drop-down (or up?) menus can be incorporated right to existing information entries.

Some design concepts:

image

image

image

image

Shortcuts were taken from here: https://gist.github.com/rochacbruno/9e4f4c471e849276f11562272db446b0

Half-width blocks can be used to make borders wider

image

Or add shadows:

image

Color inversion can be used to highlight the currently selected tab

image

Box-drawing characters can be used instead of vertical bars for better looks. I also added spaces before beginning and end of lines (I wonder why they weren’t there to begin with)

image

One more variant with grey highlighting color:

image

Andriamanitra commented 4 months ago

Hierarchical dropdown menus are rather clunky to navigate without a mouse but something a bit simpler such as showing a list of available filetypes when the "ft:unknown" is clicked would be a nice touch. I'm not sure how the implementation would work though considering the statusline string is completely customizable through statusformatl and statusformatr settings.

glupi-borna commented 3 months ago

This is a bit ambitious for now I think (especially making the statusline interactive, for reasons explained by @Andriamanitra). However, I also think that providing a plugin API for drawing on top of the buffers might not be too crazy of an idea.

I have implemented something experimental in that vein in my personal fork (although I have only done a couple things with it), so I have an idea of how it could be done -- the problem is that, at this point, it is wiser to lessen the maintenance burden on micro, so I am hesitant to start work on this.

Also, I wouldn't want to push for this without blessing from the maintainers and the wider community. Are features like this even something we want to complicate micro with?