mirror of
https://github.com/preservim/nerdtree.git
synced 2024-11-25 09:41:03 +08:00
Correctly check the type of the sort key's value. Fixes #842.
This commit is contained in:
parent
d6032c876c
commit
703e1ef4fe
|
@ -61,7 +61,6 @@ endfunction
|
||||||
function! nerdtree#compareNodesBySortKey(n1, n2)
|
function! nerdtree#compareNodesBySortKey(n1, n2)
|
||||||
let sortKey1 = a:n1.path.getSortKey()
|
let sortKey1 = a:n1.path.getSortKey()
|
||||||
let sortKey2 = a:n2.path.getSortKey()
|
let sortKey2 = a:n2.path.getSortKey()
|
||||||
|
|
||||||
let i = 0
|
let i = 0
|
||||||
while i < min([len(sortKey1), len(sortKey2)])
|
while i < min([len(sortKey1), len(sortKey2)])
|
||||||
" Compare chunks upto common length.
|
" Compare chunks upto common length.
|
||||||
|
@ -73,9 +72,9 @@ function! nerdtree#compareNodesBySortKey(n1, n2)
|
||||||
elseif sortKey1[i] ># sortKey2[i]
|
elseif sortKey1[i] ># sortKey2[i]
|
||||||
return 1
|
return 1
|
||||||
endif
|
endif
|
||||||
elseif sortKey1[i] == type(0)
|
elseif type(sortKey1[i]) == v:t_number
|
||||||
return -1
|
return -1
|
||||||
elseif sortKey2[i] == type(0)
|
elseif type(sortKey2[i]) == v:t_number
|
||||||
return 1
|
return 1
|
||||||
endif
|
endif
|
||||||
let i = i + 1
|
let i = i + 1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user