mirror of
https://github.com/preservim/nerdtree.git
synced 2024-11-22 08:45:43 +08:00
speedup: Path.getSortOrderIndex() optimisation.
This commit is contained in:
parent
9b465acb27
commit
b98c51aad1
|
@ -362,9 +362,10 @@ endfunction
|
|||
" returns the index of the pattern in g:NERDTreeSortOrder that this path matches
|
||||
function! s:Path.getSortOrderIndex()
|
||||
let i = 0
|
||||
let l:lpc = self.getLastPathComponent(1)
|
||||
while i < len(g:NERDTreeSortOrder)
|
||||
if g:NERDTreeSortOrder[i] !~? '\[\[-\?\(timestamp\|size\|extension\)\]\]' &&
|
||||
\ self.getLastPathComponent(1) =~# g:NERDTreeSortOrder[i]
|
||||
\ l:lpc =~# g:NERDTreeSortOrder[i]
|
||||
return i
|
||||
endif
|
||||
let i = i + 1
|
||||
|
@ -373,6 +374,7 @@ function! s:Path.getSortOrderIndex()
|
|||
return index(g:NERDTreeSortOrder, '*')
|
||||
endfunction
|
||||
|
||||
|
||||
" FUNCTION: Path._splitChunks(path) {{{1
|
||||
" returns a list of path chunks
|
||||
function! s:Path._splitChunks(path)
|
||||
|
|
Loading…
Reference in New Issue
Block a user