Skip to content

Commit 8535a90

Browse files
author
marty
committed
refactor MenuItem.CreateSeparator()
1 parent eef8a7b commit 8535a90

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

plugin/NERD_tree.vim

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -691,19 +691,12 @@ endfunction
691691

692692
"FUNCTION: MenuItem.CreateSeparator(options) {{{3
693693
function! s:MenuItem.CreateSeparator(options)
694-
let newMenuItem = copy(self)
695-
let newMenuItem.text = "--------------------"
696-
697-
let newMenuItem.shortcut = -1
698-
let newMenuItem.callback = -1
699-
let newMenuItem.children = []
700-
701-
let newMenuItem.isActiveCallback = -1
702-
if has_key(a:options, 'isActiveCallback')
703-
let newMenuItem.isActiveCallback = a:options['isActiveCallback']
704-
endif
694+
let standard_options = { 'text': '--------------------',
695+
\ 'shortcut': -1,
696+
\ 'callback': -1 }
697+
let options = extend(a:options, standard_options, "force")
705698

706-
call add(s:MenuItem.All(), newMenuItem)
699+
return s:MenuItem.Create(options)
707700
endfunction
708701

709702
"FUNCTION: MenuItem.enabled() {{{3

0 commit comments

Comments
 (0)