From 7425eda3e544fcb1ce81a09c5ff49d839e58ac94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Vulquin?= Date: Tue, 6 Aug 2024 14:11:59 +0200 Subject: 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. --- dot_config/nvim/lua/toast/core.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'dot_config/nvim/lua/toast/core.lua') 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} -- cgit v1.2.3