mirror of
https://github.com/preservim/nerdtree.git
synced 2024-11-22 10:55:15 +08:00
Put Callback
function variables in local scope. (#1230)
* Put `Callback` function variables in local scope. This change prevents conflict with other `Callback` functions that are defined elsewhere in global scope. * Update version number in change log.
This commit is contained in:
parent
a1fa4a33bf
commit
f63fb6984f
|
@ -5,6 +5,7 @@
|
|||
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
|
||||
-->
|
||||
#### 6.10
|
||||
- **.8**: Put `Callback` function variables in local scope. [#1230](https://github.com/preservim/nerdtree/pull/1230)
|
||||
- **.7**: Fix mouse-clicking a file to open it. (PhilRunninger) [#1225](https://github.com/preservim/nerdtree/pull/1225)
|
||||
- **.6**: Restore the default behavior of the <CR> key. (PhilRunninger) [#1221](https://github.com/preservim/nerdtree/pull/1221)
|
||||
- **.5**: Fix `{'keepopen':0}` in NERDTreeCustomOpenArgs (PhilRunninger) [#1217](https://github.com/preservim/nerdtree/pull/1217)
|
||||
|
|
|
@ -66,11 +66,11 @@ endfunction
|
|||
"FUNCTION: KeyMap.invoke() {{{1
|
||||
"Call the KeyMaps callback function
|
||||
function! s:KeyMap.invoke(...)
|
||||
let Callback = type(self.callback) ==# type(function('tr')) ? self.callback : function(self.callback)
|
||||
let l:Callback = type(self.callback) ==# type(function('tr')) ? self.callback : function(self.callback)
|
||||
if a:0
|
||||
call Callback(a:1)
|
||||
call l:Callback(a:1)
|
||||
else
|
||||
call Callback()
|
||||
call l:Callback()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@ function! s:Notifier.NotifyListeners(event, path, nerdtree, params)
|
|||
let event = g:NERDTreeEvent.New(a:nerdtree, a:path, a:event, a:params)
|
||||
|
||||
for Listener in s:Notifier.GetListenersForEvent(a:event)
|
||||
let Callback = type(Listener) == type(function('tr')) ? Listener : function(Listener)
|
||||
call Callback(event)
|
||||
let l:Callback = type(Listener) == type(function('tr')) ? Listener : function(Listener)
|
||||
call l:Callback(event)
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
|
|
|
@ -459,10 +459,10 @@ function! s:Path.ignore(nerdtree)
|
|||
endif
|
||||
endfor
|
||||
|
||||
for Callback in g:NERDTree.PathFilters()
|
||||
let Callback = type(Callback) ==# type(function('tr')) ? Callback : function(Callback)
|
||||
if Callback({'path': self, 'nerdtree': a:nerdtree})
|
||||
return 1
|
||||
for l:Callback in g:NERDTree.PathFilters()
|
||||
let l:Callback = type(l:Callback) ==# type(function('tr')) ? l:Callback : function(l:Callback)
|
||||
if l:Callback({'path': self, 'nerdtree': a:nerdtree})
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
|
Loading…
Reference in New Issue
Block a user