Skip to content

Commit 5460a5d

Browse files
author
skywind3000
committed
update weight initialization
1 parent ddc70c7 commit 5460a5d

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Then you can open the menu by pressing space twice. If the 4th parameter `filety
141141
call quickui#menu#install('&C/C++', [
142142
\ [ '&Compile', 'echo 1' ],
143143
\ [ '&Run', 'echo 2' ],
144-
\ ], -1, 'c,cpp')
144+
\ ], '<auto>', 'c,cpp')
145145
```
146146

147147
This `C/C++` menu will be visible only if the `filetype` of current buffer is `c` or `cpp`.

autoload/quickui/menu.vim

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,7 @@ function! quickui#menu#install(section, content, ...)
140140
endif
141141
if a:0 > 0 && has_key(current, a:section)
142142
if type(a:1) == v:t_number
143-
if a:1 >= 0
144-
let current[a:section].weight = a:1
145-
endif
143+
let current[a:section].weight = a:1
146144
endif
147145
endif
148146
if a:0 > 1 && has_key(current, a:section)

0 commit comments

Comments
 (0)