mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.94k stars 716 forks source link

Improve the custom completion menu #1260

Closed lenormf closed 7 years ago

lenormf commented 7 years ago

Hi,

The window that pops up when a custom completion backend is triggered could be improve, in order to make it look more like the regular completion menu:

Thanks.

mawww commented 7 years ago

You 3 first points are easy to fix: dont put that info in the docstring, but in the menu entry text.

I think the current behaviour is correct, the docstring is for big documentation text, so we can only display one docstring at a time. Single line additional documentation can be just put in the menu entry.

For the last point, if the menu contains some additional info, the problem goes away.

lenormf commented 7 years ago

I thought markup didn't work in those windows, but they do, so it's all good now.

mawww commented 7 years ago

Yeah, at some point I'd like to have markup work fine in the info windows as well.

casimir commented 7 years ago

@mawww me too

screen shot 2017-03-07 at 13 37 45

Another thing I'd like is a way to provide complementary information in menus, with a different face and right aligned. Kind of like the file path when completing commands in kak files. That would be useful to add semantic information like symbol type or signature. I tried to emulate it in racer.kak by using the dim attribute but it's not working in all terminal and that's more work when coding the binding. You can see it in the screenshot above btw.

danr commented 7 years ago

Since the menu info can contain code snippets (like in your example above @casimir) we might want to be able to apply highlighters, too. We shouldn't have to reimplement syntax highlighting yielding markup.

mawww commented 7 years ago

Using the highlighting system on non buffers is going to be pretty hard, and a bit overkill for what we are trying to do here, I'd be more leaning towards a light markup system.

casimir commented 7 years ago

There 2 good points here:

I think using "monochrome" faces are enough by playing with "weight" attributes (bold, italic, underlined). We could reuse asciidoc markup for emphasize and strong text as an experiment and see if we need more.