Skip to content

Commit cc0777b

Browse files
committed
move KeyMap_Invoke into the autoload file
This will keep the class file cleaner, and may also fix preservim#223
1 parent 8a98426 commit cc0777b

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

autoload/nerdtree.vim

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,13 @@ function! nerdtree#initNerdTreeMirror()
371371
endif
372372
endfunction
373373

374+
" FUNCTION: nerdtree#invokeKeyMap(key) {{{2
375+
"this is needed since I cant figure out how to invoke dict functions from a
376+
"key map
377+
function! nerdtree#invokeKeyMap(key)
378+
call g:NERDTreeKeyMap.Invoke(a:key)
379+
endfunction
380+
374381
" FUNCTION: nerdtree#nextBufferName() {{{2
375382
" returns the buffer name for the next nerd tree
376383
function! nerdtree#nextBufferName()

plugin/nerdtree/key_map.vim

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function! s:KeyMap.bind()
4343

4444
let premap = self.key == "<LeftRelease>" ? " <LeftRelease>" : " "
4545

46-
exec 'nnoremap <buffer> <silent> '. self.key . premap . ':call <SID>KeyMap_Invoke("'. keymapInvokeString .'")<cr>'
46+
exec 'nnoremap <buffer> <silent> '. self.key . premap . ':call nerdtree#invokeKeyMap("'. keymapInvokeString .'")<cr>'
4747
endfunction
4848

4949
"FUNCTION: KeyMap.Remove(key, scope) {{{3
@@ -121,12 +121,6 @@ function! s:KeyMap.Invoke(key)
121121
endif
122122
endfunction
123123

124-
"this is needed since I cant figure out how to invoke dict functions from a
125-
"key map
126-
function! s:KeyMap_Invoke(key)
127-
call s:KeyMap.Invoke(a:key)
128-
endfunction
129-
130124
"FUNCTION: KeyMap.Create(options) {{{3
131125
function! s:KeyMap.Create(options)
132126
let newKeyMap = copy(self)
@@ -145,3 +139,4 @@ function! s:KeyMap.Add(keymap)
145139
call add(s:KeyMap.All(), a:keymap)
146140
endfunction
147141

142+
" vim: set sw=4 sts=4 et fdm=marker:

0 commit comments

Comments
 (0)