mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 03:43:50 -05:00
Merge pull request #849 from lifecrisis/sort-maps
This commit is contained in:
@@ -5,12 +5,30 @@ let g:NERDTreeKeyMap = s:KeyMap
|
|||||||
|
|
||||||
"FUNCTION: KeyMap.All() {{{1
|
"FUNCTION: KeyMap.All() {{{1
|
||||||
function! s:KeyMap.All()
|
function! s:KeyMap.All()
|
||||||
if !exists("s:keyMaps")
|
|
||||||
|
if !exists('s:keyMaps')
|
||||||
let s:keyMaps = []
|
let s:keyMaps = []
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
call sort(s:keyMaps, s:KeyMap.Compare, s:KeyMap)
|
||||||
|
|
||||||
return s:keyMaps
|
return s:keyMaps
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
"FUNCTION: KeyMap.Compare(keyMap1, keyMap2) {{{1
|
||||||
|
function! s:KeyMap.Compare(keyMap1, keyMap2)
|
||||||
|
|
||||||
|
if a:keyMap1.key >? a:keyMap2.key
|
||||||
|
return 1
|
||||||
|
endif
|
||||||
|
|
||||||
|
if a:keyMap1.key <? a:keyMap2.key
|
||||||
|
return -1
|
||||||
|
endif
|
||||||
|
|
||||||
|
return 0
|
||||||
|
endfunction
|
||||||
|
|
||||||
"FUNCTION: KeyMap.FindFor(key, scope) {{{1
|
"FUNCTION: KeyMap.FindFor(key, scope) {{{1
|
||||||
function! s:KeyMap.FindFor(key, scope)
|
function! s:KeyMap.FindFor(key, scope)
|
||||||
for i in s:KeyMap.All()
|
for i in s:KeyMap.All()
|
||||||
|
|||||||
Reference in New Issue
Block a user