|
1 | 1 | local M = {}
|
2 | 2 |
|
3 |
| -local has_v_0_11 = vim.fn.has('nvim-0.11') > 0 |
| 3 | +-- local has_v_0_11 = vim.fn.has('nvim-0.11') > 0 |
4 | 4 |
|
5 | 5 | --- Use the faster validate version if available
|
6 | 6 | -- Taken from: https://github.com/lukas-reineke/indent-blankline.nvim/pull/934/files#diff-09ebcaa8c75cd1e92d25640e377ab261cfecaf8351c9689173fd36c2d0c23d94R16
|
7 | 7 | --- @param spec table<string,[any, vim.validate.Validator, boolean|string]>
|
8 | 8 | function M.validate(spec)
|
9 |
| - if not has_v_0_11 then |
10 |
| - return vim.validate(spec) |
11 |
| - end |
12 |
| - for key, key_spec in pairs(spec) do |
13 |
| - local message = type(key_spec[3]) == 'string' and key_spec[3] or nil --[[@as string?]] |
14 |
| - local optional = type(key_spec[3]) == 'boolean' and key_spec[3] or nil --[[@as boolean?]] |
15 |
| - ---@diagnostic disable-next-line:param-type-mismatch, redundant-parameter |
16 |
| - vim.validate(key, key_spec[1], key_spec[2], optional, message) |
17 |
| - end |
| 9 | + -- if not has_v_0_11 then |
| 10 | + return vim.validate(spec) |
| 11 | + -- end |
| 12 | + -- for key, key_spec in pairs(spec) do |
| 13 | + -- local message = type(key_spec[3]) == 'string' and key_spec[3] or nil --[[@as string?]] |
| 14 | + -- local optional = type(key_spec[3]) == 'boolean' and key_spec[3] or nil --[[@as boolean?]] |
| 15 | + -- ---@diagnostic disable-next-line:param-type-mismatch, redundant-parameter |
| 16 | + -- vim.validate(key, key_spec[1], key_spec[2], optional, message) |
| 17 | + -- end |
18 | 18 | end
|
19 | 19 |
|
20 | 20 | return M
|
0 commit comments