Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix - ensure keymaps dictionary exists before using it #852

Merged
merged 1 commit into from
Jun 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions lib/nerdtree/key_map.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,11 @@
"============================================================
let s:KeyMap = {}
let g:NERDTreeKeyMap = s:KeyMap

"FUNCTION: KeyMap._all() {{{1
function! s:KeyMap._all()
if !exists("s:keyMaps")
let s:keyMaps = {}
endif

return s:keyMaps
endfunction
let s:keyMaps = {}

"FUNCTION: KeyMap.All() {{{1
function! s:KeyMap.All()
let sortedKeyMaps = values(s:KeyMap._all())
let sortedKeyMaps = values(s:keyMaps)
call sort(sortedKeyMaps, s:KeyMap.Compare, s:KeyMap)

return sortedKeyMaps
Expand All @@ -36,12 +28,12 @@ endfunction

"FUNCTION: KeyMap.FindFor(key, scope) {{{1
function! s:KeyMap.FindFor(key, scope)
return get(s:KeyMap._all(), a:key . a:scope, {})
return get(s:keyMaps, a:key . a:scope, {})
endfunction

"FUNCTION: KeyMap.BindAll() {{{1
function! s:KeyMap.BindAll()
for i in values(s:KeyMap._all())
for i in values(s:keyMaps)
call i.bind()
endfor
endfunction
Expand Down