refactor(#2829): multi instance nvim-tree.explorer.sorters#2835
refactor(#2829): multi instance nvim-tree.explorer.sorters#2835alex-courtis merged 8 commits intonvim-tree:masterfrom
Conversation
alex-courtis
left a comment
There was a problem hiding this comment.
This is just fantastic! Thank you for leading the charge here.
This one will be the pattern for other such tasks!
|
Thank you, @alex-courtis I'm glad you liked it. I'm just really excited about this functionality and happy to help. |
alex-courtis
left a comment
There was a problem hiding this comment.
Looking really good... except for the presets.
auto refresh OK
sort = {
sorter = "name",
folders_first = true,
files_first = false,
},
filesystem_watchers = {
enable = true,
},manual refresh OK
sort = {
sorter = "name",
folders_first = true,
files_first = false,
},
filesystem_watchers = {
enable = false,
},file/folder comb OK
sort = {
sorter = "name",
folders_first = false,
files_first = false,
},
filesystem_watchers = {
enable = false,
}, sort = {
sorter = "name",
folders_first = false,
files_first = true,
},
filesystem_watchers = {
enable = false,
}, sort = {
sorter = "name",
folders_first = true,
files_first = true,
},
filesystem_watchers = {
enable = false,
},function OK
sort = {
sorter = function(nodes)
table.sort(nodes, function(a, b)
return #a.name < #b.name
end)
end,
folders_first = true,
files_first = false,
},
filesystem_watchers = {
enable = true,
},extension NO, similar for other presets
sort = {
sorter = "extension",
folders_first = true,
files_first = false,
},
filesystem_watchers = {
enable = true,
},E5108: Error executing lua: .../packer/start/raaymax/lua/nvim-tree/explorer/sorters.lua:46: attempt to index local 'cfg' (a nil value)
stack traceback:
.../packer/start/raaymax/lua/nvim-tree/explorer/sorters.lua:46: in function 'folders_or_files_first'
.../packer/start/raaymax/lua/nvim-tree/explorer/sorters.lua:198: in function 'comparator'
.../packer/start/raaymax/lua/nvim-tree/explorer/sorters.lua:74: in function 'merge'
.../packer/start/raaymax/lua/nvim-tree/explorer/sorters.lua:110: in function 'split_merge'
.../packer/start/raaymax/lua/nvim-tree/explorer/sorters.lua:108: in function 'split_merge'
.../packer/start/raaymax/lua/nvim-tree/explorer/sorters.lua:108: in function 'split_merge'
.../packer/start/raaymax/lua/nvim-tree/explorer/sorters.lua:108: in function 'split_merge'
.../packer/start/raaymax/lua/nvim-tree/explorer/sorters.lua:108: in function 'split_merge'
.../packer/start/raaymax/lua/nvim-tree/explorer/sorters.lua:108: in function 'split_merge'
.../packer/start/raaymax/lua/nvim-tree/explorer/sorters.lua:160: in function 'sort'
.../packer/start/raaymax/lua/nvim-tree/explorer/explore.lua:83: in function 'explore'
...ack/packer/start/raaymax/lua/nvim-tree/explorer/init.lua:52: in function '_load'
...ack/packer/start/raaymax/lua/nvim-tree/explorer/init.lua:43: in function 'new'
...nd/site/pack/packer/start/raaymax/lua/nvim-tree/core.lua:20: in function 'init'
.../nd/site/pack/packer/start/raaymax/lua/nvim-tree/lib.lua:261: in function 'open'
...packer/start/raaymax/lua/nvim-tree/actions/tree/open.lua:32: in function 'open'
| absolute_path = path, | ||
| nodes = {}, | ||
| open = true, | ||
| sorters = Sorters:new(M.config), |
There was a problem hiding this comment.
That worked out rather nicely.
|
Apologies for the delayed review; I'm only able to work on nvim-tree on weekends (AEST). |
|
@alex-courtis accidental close? |
Oh crap, thank you. No more |
|
I fixed issue you mentioned. |
88a50c0 to
0ad7258
Compare
alex-courtis
left a comment
There was a problem hiding this comment.
Just fantastic...
All test + all presets tested OK.
Implementation for #2829
fixes #2829