Skip to content

Commit

Permalink
update weight initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
skywind3000 committed Jan 9, 2020
1 parent ddc70c7 commit 5460a5d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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')
\ ], '<auto>', 'c,cpp')
```

This `C/C++` menu will be visible only if the `filetype` of current buffer is `c` or `cpp`.
Expand Down
4 changes: 1 addition & 3 deletions autoload/quickui/menu.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5460a5d

Please sign in to comment.