feat: case insensitive sorting (#429)

* check for sorting option in netrw

* documentation

* refactor: remove sort_ prefix

---------

Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
This commit is contained in:
Philipp Oeschger 2024-07-01 20:41:04 +02:00 committed by GitHub
parent c7c7ce5bd4
commit 2077cc3358
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 15 additions and 3 deletions

View file

@ -300,11 +300,17 @@ M.register("name", {
end,
get_sort_value = function(entry)
local sort_value = entry[FIELD_NAME]
if config.view_options.natural_order then
return entry[FIELD_NAME]:gsub("%d+", pad_number)
else
return entry[FIELD_NAME]
sort_value = sort_value:gsub("%d+", pad_number)
end
if config.view_options.case_insensitive then
sort_value = sort_value:lower()
end
return sort_value
end,
})