Sort by file extensions (#230)

- preserve natural ordering of filenames if extensions are the same
  or are missing
- files without extensions rank higher on ascending sort and lower
  on descending sort
This commit is contained in:
Kennedy Mwenja authored and gokcehan committed 2019-10-04 21:44:52 +03:00
1 parent 41339a9e5a
commit 9991a40e87
4 files changed
+32 -1

No files matched your search

+3 -1
View File
@@ -251,8 +251,10 @@ func (e *setExpr) eval(app *app, args []string) {
gOpts.sortType.method = ctimeSort
case "atime":
gOpts.sortType.method = atimeSort
case "ext":
gOpts.sortType.method = extSort
default:
app.ui.echoerr("sortby: value should either be 'natural', 'name', 'size', 'time', 'atime' or 'ctime'")
app.ui.echoerr("sortby: value should either be 'natural', 'name', 'size', 'time', 'atime', 'ctime' or 'ext'")
return
}
app.nav.sort()