mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-10 12:23:49 -05:00
Refactor code to use getSortKey() and replace regular expression with
simple string comparison in tree_dir_node.vim
This commit is contained in:
@@ -34,11 +34,11 @@ function! nerdtree#compareNodes(n1, n2)
|
||||
return a:n1.path.compareTo(a:n2.path)
|
||||
endfunction
|
||||
|
||||
"FUNCTION: nerdtree#compareNodesBySortingToken(n1, n2) {{{2
|
||||
function! nerdtree#compareNodesBySortingToken(n1, n2)
|
||||
if a:n1.sorting_token < a:n2.sorting_token
|
||||
"FUNCTION: nerdtree#compareNodesBySortKey(n1, n2) {{{2
|
||||
function! nerdtree#compareNodesBySortKey(n1, n2)
|
||||
if a:n1.path.getSortKey() < a:n2.path.getSortKey()
|
||||
return -1
|
||||
elseif a:n1.sorting_token > a:n2.sorting_token
|
||||
elseif a:n1.path.getSortKey() > a:n2.path.getSortKey()
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user