diff options
| author | 2024-08-06 14:11:59 +0200 | |
|---|---|---|
| committer | 2024-08-06 14:11:59 +0200 | |
| commit | 7425eda3e544fcb1ce81a09c5ff49d839e58ac94 (patch) | |
| tree | e74368e016160f5c7aa5b532b46c9190e21fc32e /dot_config/nvim/lua/toast/core.lua | |
| parent | nvim: expand .lua gitattributes, mark as non-diffable (diff) | |
nvim: rework lsp module
There's still some improvements to be made, but this is cleaner.
We lose global caps defaults, but those made no sense to begin with.
We do also lose caps overrides, I'll add them back in if I need them.
In the process, we gain `every?` and `executable?`.
There's also a misc comp print vim.inspect to vim.print change.
Diffstat (limited to 'dot_config/nvim/lua/toast/core.lua')
| -rw-r--r-- | dot_config/nvim/lua/toast/core.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/dot_config/nvim/lua/toast/core.lua b/dot_config/nvim/lua/toast/core.lua index b2a2e95..6daae14 100644 --- a/dot_config/nvim/lua/toast/core.lua +++ b/dot_config/nvim/lua/toast/core.lua @@ -17,6 +17,14 @@ end local function number_3f(n) return ("number" == type(n)) end +local function every_3f(pred, xs) + local pass = true + for _, x in ipairs(xs) do + if not pass then break end + pass = pred(x) + end + return pass +end local function drop(n, xs) local out = {} for i, v in ipairs(xs) do @@ -115,4 +123,4 @@ local function map(f, xs) end return out end -return {dec = dec, inc = inc, ["empty?"] = empty_3f, ["nil?"] = nil_3f, ["number?"] = number_3f, drop = drop, first = first, last = last, group = group, assoc = assoc, map = map} +return {dec = dec, inc = inc, ["empty?"] = empty_3f, ["nil?"] = nil_3f, ["number?"] = number_3f, ["every?"] = every_3f, drop = drop, first = first, last = last, group = group, assoc = assoc, map = map} |
