Git Product home page Git Product logo

Comments (4)

gelguy avatar gelguy commented on May 30, 2024

There's a few problems wrong with the config, mostly caused by using wilder#wildmenu_renderer() options in wilder#popupmenu_renderer():

  1. wilder#basic_highlighter() should be under the highlighter option, not highlights. The apply_highlights option is deprecated in favour of highlighter, so you can remove that option. wilder#query_common_subsequence_spans() is also the old name of wilder#basic_highlighter().
  2. separator is not used in the popupmenu and should be removed
  3. left and right take different kinds of arguments so the wildmenu items cannot be reused here.

This minimal config should work for you:

call wilder#set_option('renderer', wilder#popupmenu_renderer({
			\ 'highlighter': wilder#basic_highlighter(),
			\ }))

To decorate the popupmenu a bit more:

" wilder#popupmenu_devicons() needs 'ryanoasis/vim-devicons' to be installed
call wilder#set_option('renderer', wilder#popupmenu_renderer({
			\ 'highlighter': wilder#basic_highlighter(),
                        \ 'left': [
                        \   wilder#popupmenu_devicons(),
                        \   wilder#popupmenu_buffer_flags(),
                        \ ],
                        \ 'right': [
                        \   ' ',
                        \   wilder#popupmenu_spinner(),
                        \  wilder#popupmenu_scrollbar(),
                        \ ],
			\ }))

I did a big renaming of the API in #29 so for wildmenu the left or right items are prefixed with wilder#wildmenu_... and for popupmenu they are prefixed with wilder#popupmenu.... The old names can still be used for backwards compatability and I apologise if this created more confusion, but moving forward the new names should give a better indication of where they can be used.

from wilder.nvim.

gennaro-tedesco avatar gennaro-tedesco commented on May 30, 2024

Thank you, it works like a charm and looks great: I will be having a look at the changelog of #29 to be better informed. For reference (if someone else comes across this issue) I am using:

call wilder#set_option('renderer', wilder#renderer_mux({
      \ ':': wilder#popupmenu_renderer({
		\ 'highlighter': wilder#basic_highlighter(),
      \ }),
      \ '/': wilder#wildmenu_renderer(
      \ wilder#lightline_theme({
      \   'highlights': {},
      \   'highlighter': wilder#basic_highlighter(),
      \   'separator': ' ยท ',
      \ })
      \ ),
      \ }))

One last question: is it possible to determine the height of the popup menu when it opens, namely to customise how many items are being shown at a first glance?

from wilder.nvim.

gelguy avatar gelguy commented on May 30, 2024

Yes, the max_height option does this.

You can set it to a string e.g. '50%' so it takes up to 50% of Neovim's height or to a number 20 (note: no quotes) so it takes up to 20 lines in height.

:h wilder#popupmenu_renderer() will describe more of the other options (e.g. max_width).

from wilder.nvim.

gennaro-tedesco avatar gennaro-tedesco commented on May 30, 2024

Awesome, this will do. Feel free to close this issue! :)

from wilder.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.