mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-11 04:43:49 -05:00
Option for mixing dot files when sorting
NERDTree can now optionally ignore the dot at the beginning of hidden filenames for sorting to show them next to normal files if `g:NERDTreeSortHiddenFirst` is set to 0. (By default it's set to 1 to preserve the current behavior.) This is just like what GNU ls does when `LC_COLLATE` environment variable is set to `en_US`.
This commit is contained in:
@@ -103,6 +103,10 @@ function! s:Path.compareTo(path)
|
||||
elseif thisSS > thatSS
|
||||
return 1
|
||||
else
|
||||
if !g:NERDTreeSortHiddenFirst
|
||||
let thisPath = substitute(thisPath, '^[._]', '', '')
|
||||
let thatPath = substitute(thatPath, '^[._]', '', '')
|
||||
endif
|
||||
"if the sort sequences are the same then compare the paths
|
||||
"alphabetically
|
||||
let pathCompare = g:NERDTreeCaseSensitiveSort ? thisPath <# thatPath : thisPath <? thatPath
|
||||
|
||||
Reference in New Issue
Block a user