Files
neovim/runtime/lua/vim
Justin M. Keyes 9912a4c81b refactor(lua): deprecate tbl_flatten
Problem:
Besides being redundant with vim.iter():flatten(), `tbl_flatten` has
these problems:

- Has `tbl_` prefix but only accepts lists.
- Discards some results! Compare the following:
  - iter.flatten():
    ```
    vim.iter({1, { { a = 2 } }, { 3 } }):flatten():totable()
    ```
  - tbl_flatten:
    ```
    vim.tbl_flatten({1, { { a = 2 } }, { 3 } })
    ```

Solution:
Deprecate tbl_flatten.

Note:
iter:flatten() currently fails ("flatten() requires a list-like table")
on this code from gen_lsp.lua:

    local anonym = vim.iter({ -- remove nil
      anonymous_num > 1 and '' or nil,
      '---@class ' .. anonymous_classname,
    }):flatten():totable()

Should we enhance :flatten() to work for arrays?
2024-04-22 02:11:23 +02:00
..
2024-04-22 02:11:23 +02:00
2024-03-06 10:45:22 +00:00
2024-03-09 11:21:55 +00:00
2024-01-16 09:33:10 +00:00
2024-01-19 11:54:04 +00:00
2024-03-16 19:26:10 +00:00
2024-03-16 19:26:10 +00:00
2024-03-06 10:45:22 +00:00
2024-03-16 19:26:10 +00:00
2024-03-16 19:26:10 +00:00
2024-03-16 19:26:10 +00:00
2024-03-16 19:26:10 +00:00
2024-03-09 11:21:55 +00:00
2024-03-09 11:21:55 +00:00