Compare commits

...

2 Commits
6.4.0 ... 6.4.1

Author SHA1 Message Date
Phil Runninger
1ab85e33be Update version in change log. 2019-12-16 09:06:45 -05:00
Phil Runninger
c962796b03 Ensure backward compatibility. v:t_func is not available before 8.0. 2019-12-16 09:04:16 -05:00
5 changed files with 6 additions and 5 deletions

View File

@@ -8,6 +8,7 @@
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
-->
#### 6.4
- **.1**: Ensure backward compatibility. v:t_func is not available before Vim 8.0 (Phil Runninger)
- **.0**: Allow use of function references as callbacks (HiPhish) [#1067](https://github.com/scrooloose/nerdtree/pull/1067)
#### 6.3
- **.0**: Add new command that behaves like NERDTreeToggle but defaults to the root of a VCS repository. (willfindlay) [#1060](https://github.com/scrooloose/nerdtree/pull/1060)

View File

@@ -66,7 +66,7 @@ endfunction
"FUNCTION: KeyMap.invoke() {{{1
"Call the KeyMaps callback function
function! s:KeyMap.invoke(...)
let Callback = type(self.callback) == v:t_func ? self.callback : function(self.callback)
let Callback = type(self.callback) == type(function("tr")) ? self.callback : function(self.callback)
if a:0
call Callback(a:1)
else

View File

@@ -79,7 +79,7 @@ endfunction
"specified
function! s:MenuItem.enabled()
if self.isActiveCallback != -1
return type(self.isActiveCallback) == v:t_func ? self.isActiveCallback() : {self.isActiveCallback}()
return type(self.isActiveCallback) == type(function("tr")) ? self.isActiveCallback() : {self.isActiveCallback}()
endif
return 1
endfunction
@@ -94,7 +94,7 @@ function! s:MenuItem.execute()
call mc.showMenu()
else
if self.callback != -1
if type(self.callback) == v:t_func
if type(self.callback) == type(function("tr"))
call self.callback()
else
call {self.callback}()

View File

@@ -15,7 +15,7 @@ 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) == v:t_func ? Listener : function(Listener)
let Callback = type(Listener) == type(function("tr")) ? Listener : function(Listener)
call Callback(event)
endfor
endfunction

View File

@@ -501,7 +501,7 @@ function! s:Path.ignore(nerdtree)
endfor
for Callback in g:NERDTree.PathFilters()
let Callback = type(Callback) == v:t_func ? Callback : function(Callback)
let Callback = type(Callback) == type(function("tr")) ? Callback : function(Callback)
if Callback({'path': self, 'nerdtree': a:nerdtree})
return 1
endif