plenary.nvim
plenary.nvim copied to clipboard
scandir: Provide a method to modify each item of table returned
Something like on_insert but to modify the strings that are inserted in the output table.
Yes, we could always just another ipairs loop and do that, but more convenient this way.
This can be used with iterators.lua ie with
iter.iter(repo_paths)
:map(function(repo_path) return _utils.get_project_from_path(repo_path) end)
:tolist()
Suggestion to close.
We could add a option to disable the capturing. aka adding it to a table. So you only create on table, the one in on_insert
We have something similar for plenary.job
. https://github.com/nvim-lua/plenary.nvim/blob/6bb0e09030a7c2af19bf288088ca815228de9429/lua/plenary/job.lua#L137-L144