فهرست منبع

Grouping of files in ambiguous sort orders

Try to group files by name/path in 'extension' and 'name' sort order.
Yuriy Ershov 10 سال پیش
والد
کامیت
86ecb828a6
1فایلهای تغییر یافته به همراه13 افزوده شده و 0 حذف شده
  1. 13 0
      plugin/bufexplorer.vim

+ 13 - 0
plugin/bufexplorer.vim

@@ -1053,6 +1053,9 @@ function! s:SortListing()
         " Easiest case.
         execute sort 'n'
     elseif g:bufExplorerSortBy == "name"
+        " Sort by full path first
+        execute sort 'ir /\zs\f\+\ze\s\+line/'
+
         if g:bufExplorerSplitOutPathName
             execute sort 'ir /\d.\{7}\zs\f\+\ze/'
         else
@@ -1066,6 +1069,16 @@ function! s:SortListing()
 
         execute sort 'ir /\zs\f\+\ze\s\+line/'
     elseif g:bufExplorerSortBy == "extension"
+        " Sort by full path...
+        execute sort 'ir /\zs\f\+\ze\s\+line/'
+
+        " Sort by name...
+        if g:bufExplorerSplitOutPathName
+            " Sort twice - first on the file name then on the path.
+            execute sort 'ir /\d.\{7}\zs\f\+\ze/'
+        endif
+
+        " Sort by extension
         execute sort 'ir /\.\zs\w\+\ze\s/'
     elseif g:bufExplorerSortBy == "mru"
         let l = getline(s:firstBufferLine, "$")