Files
neovim/runtime/doc
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
..
2023-07-25 05:07:13 -07:00
2023-10-29 16:02:32 +08:00
2024-01-17 14:01:39 +08:00
2024-04-08 22:51:00 +02:00
2024-04-12 16:56:22 +08:00
2024-02-08 19:07:31 +08:00
2023-12-13 20:31:16 +01:00
2024-04-19 14:49:33 +08:00
2023-10-29 16:02:32 +08:00
2024-04-11 07:39:29 +08:00
2024-02-29 22:54:57 +01:00
2024-04-11 07:39:29 +08:00
2023-12-06 08:04:21 +08:00
2024-04-22 02:11:23 +02:00
2024-03-12 13:51:53 +08:00
2024-02-22 10:07:04 +01:00
2024-03-12 13:51:53 +08:00
2024-01-18 00:14:48 -08:00
2023-10-21 18:04:08 +08:00
2023-11-14 23:29:09 +01:00
2023-11-06 19:03:08 +08:00
2024-04-16 08:13:21 +08:00
2024-01-18 00:14:48 -08:00
2023-10-10 19:20:32 +02:00
2023-09-28 05:22:09 +08:00
2023-11-27 17:43:13 +08:00
2024-04-18 23:39:26 +02:00
2024-04-22 00:18:34 +02:00
2024-03-16 16:38:40 +08:00
2023-08-10 17:28:02 +08:00
2023-08-13 13:25:10 +01:00
2023-08-10 17:28:04 +08:00
2023-07-25 05:07:13 -07:00
2024-04-05 15:45:13 +02:00
2023-07-25 05:07:13 -07:00