feat: use natural sort order by default (#328)
* Sort entries with natural sorting * refactor: move natural ordering logic and add config option --------- Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
This commit is contained in:
parent
e045ee3b4e
commit
71b076b3af
3 changed files with 20 additions and 2 deletions
|
|
@ -519,7 +519,14 @@ end
|
|||
---@return fun(a: oil.InternalEntry, b: oil.InternalEntry): boolean
|
||||
local function get_sort_function(adapter)
|
||||
local idx_funs = {}
|
||||
for _, sort_pair in ipairs(config.view_options.sort) do
|
||||
local sort_config = config.view_options.sort
|
||||
|
||||
-- If empty, default to type + name sorting
|
||||
if vim.tbl_isempty(sort_config) then
|
||||
sort_config = { { "type", "asc" }, { "name", "asc" } }
|
||||
end
|
||||
|
||||
for _, sort_pair in ipairs(sort_config) do
|
||||
local col_name, order = unpack(sort_pair)
|
||||
if order ~= "asc" and order ~= "desc" then
|
||||
vim.notify_once(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue