diff --git a/README.md b/README.md index a4af63a..7f8afcd 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ Then you can open the menu by pressing space twice. If the 4th parameter `filety call quickui#menu#install('&C/C++', [ \ [ '&Compile', 'echo 1' ], \ [ '&Run', 'echo 2' ], - \ ], -1, 'c,cpp') + \ ], '', 'c,cpp') ``` This `C/C++` menu will be visible only if the `filetype` of current buffer is `c` or `cpp`. diff --git a/autoload/quickui/menu.vim b/autoload/quickui/menu.vim index d1dbe8b..4d6d2d1 100644 --- a/autoload/quickui/menu.vim +++ b/autoload/quickui/menu.vim @@ -140,9 +140,7 @@ function! quickui#menu#install(section, content, ...) endif if a:0 > 0 && has_key(current, a:section) if type(a:1) == v:t_number - if a:1 >= 0 - let current[a:section].weight = a:1 - endif + let current[a:section].weight = a:1 endif endif if a:0 > 1 && has_key(current, a:section)