refactor MenuItem.CreateSeparator()
This commit is contained in:
parent
eef8a7b280
commit
8535a906be
@ -691,19 +691,12 @@ endfunction
|
|||||||
|
|
||||||
"FUNCTION: MenuItem.CreateSeparator(options) {{{3
|
"FUNCTION: MenuItem.CreateSeparator(options) {{{3
|
||||||
function! s:MenuItem.CreateSeparator(options)
|
function! s:MenuItem.CreateSeparator(options)
|
||||||
let newMenuItem = copy(self)
|
let standard_options = { 'text': '--------------------',
|
||||||
let newMenuItem.text = "--------------------"
|
\ 'shortcut': -1,
|
||||||
|
\ 'callback': -1 }
|
||||||
|
let options = extend(a:options, standard_options, "force")
|
||||||
|
|
||||||
let newMenuItem.shortcut = -1
|
return s:MenuItem.Create(options)
|
||||||
let newMenuItem.callback = -1
|
|
||||||
let newMenuItem.children = []
|
|
||||||
|
|
||||||
let newMenuItem.isActiveCallback = -1
|
|
||||||
if has_key(a:options, 'isActiveCallback')
|
|
||||||
let newMenuItem.isActiveCallback = a:options['isActiveCallback']
|
|
||||||
endif
|
|
||||||
|
|
||||||
call add(s:MenuItem.All(), newMenuItem)
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
"FUNCTION: MenuItem.enabled() {{{3
|
"FUNCTION: MenuItem.enabled() {{{3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user