plenary.nvim icon indicating copy to clipboard operation
plenary.nvim copied to clipboard

scandir: Provide a method to modify each item of table returned

Open Akianonymus opened this issue 3 years ago • 3 comments

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.

Akianonymus avatar Jul 31 '21 14:07 Akianonymus

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.

matu3ba avatar Oct 03 '21 21:10 matu3ba

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

Conni2461 avatar Oct 04 '21 19:10 Conni2461

We have something similar for plenary.job. https://github.com/nvim-lua/plenary.nvim/blob/6bb0e09030a7c2af19bf288088ca815228de9429/lua/plenary/job.lua#L137-L144

Conni2461 avatar Oct 04 '21 19:10 Conni2461