commit 8535a906beddbdab5458a5a42ba55e0fc0d6c599
parent eef8a7b280ad8a98b7b7554945807e114a6458c8
Author: marty <martin_grenfell@msn.com>
Date: Wed, 19 Aug 2009 15:44:53 +1200
refactor MenuItem.CreateSeparator()
Diffstat:
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim
@@ -691,19 +691,12 @@ endfunction
"FUNCTION: MenuItem.CreateSeparator(options) {{{3
function! s:MenuItem.CreateSeparator(options)
- let newMenuItem = copy(self)
- let newMenuItem.text = "--------------------"
-
- let newMenuItem.shortcut = -1
- let newMenuItem.callback = -1
- let newMenuItem.children = []
-
- let newMenuItem.isActiveCallback = -1
- if has_key(a:options, 'isActiveCallback')
- let newMenuItem.isActiveCallback = a:options['isActiveCallback']
- endif
+ let standard_options = { 'text': '--------------------',
+ \ 'shortcut': -1,
+ \ 'callback': -1 }
+ let options = extend(a:options, standard_options, "force")
- call add(s:MenuItem.All(), newMenuItem)
+ return s:MenuItem.Create(options)
endfunction
"FUNCTION: MenuItem.enabled() {{{3