mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 11:53:48 -05:00
rename check_to_enable_callback to isActiveCallback
This commit is contained in:
@@ -24,7 +24,7 @@ let g:loaded_nerdtree_git_menu = 1
|
|||||||
call NERDTreeAddMenuItem({
|
call NERDTreeAddMenuItem({
|
||||||
\ 'text': '(g)it menu',
|
\ 'text': '(g)it menu',
|
||||||
\ 'shortcut': 'g',
|
\ 'shortcut': 'g',
|
||||||
\ 'check_to_enable_callback': 'NERDTreeGitMenuEnabled',
|
\ 'isActiveCallback': 'NERDTreeGitMenuEnabled',
|
||||||
\ 'callback': 'NERDTreeGitMenu' })
|
\ 'callback': 'NERDTreeGitMenu' })
|
||||||
|
|
||||||
function! NERDTreeGitMenuEnabled()
|
function! NERDTreeGitMenuEnabled()
|
||||||
|
|||||||
@@ -470,16 +470,16 @@ function! s:MenuItem.Create(options)
|
|||||||
let newMenuItem.text = a:options['text']
|
let newMenuItem.text = a:options['text']
|
||||||
let newMenuItem.shortcut = a:options['shortcut']
|
let newMenuItem.shortcut = a:options['shortcut']
|
||||||
let newMenuItem.callback = a:options['callback']
|
let newMenuItem.callback = a:options['callback']
|
||||||
if has_key(a:options, 'check_to_enable_callback')
|
if has_key(a:options, 'isActiveCallback')
|
||||||
let newMenuItem.check_to_enable_callback = a:options['check_to_enable_callback']
|
let newMenuItem.isActiveCallback = a:options['isActiveCallback']
|
||||||
endif
|
endif
|
||||||
call add(s:MenuItem.All(), newMenuItem)
|
call add(s:MenuItem.All(), newMenuItem)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
"FUNCTION: MenuItem.enabled() {{{3
|
"FUNCTION: MenuItem.enabled() {{{3
|
||||||
function! s:MenuItem.enabled()
|
function! s:MenuItem.enabled()
|
||||||
if has_key(self, "check_to_enable_callback")
|
if has_key(self, "isActiveCallback")
|
||||||
return {self.check_to_enable_callback}()
|
return {self.isActiveCallback}()
|
||||||
endif
|
endif
|
||||||
return 1
|
return 1
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
Reference in New Issue
Block a user