aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2023-09-13 10:53:03 +0100
committerChristian Clason <c.clason@uni-graz.at>2025-05-12 18:43:40 +0200
commit5f2c6c0c833734914080ae061e2a7d44bc606180 (patch)
tree7243b308001bf260d3152e706a24c4366b503dcc
parentfix: update vim.system types (diff)
downloadnvim-treesitter-5f2c6c0c833734914080ae061e2a7d44bc606180.tar
nvim-treesitter-5f2c6c0c833734914080ae061e2a7d44bc606180.tar.gz
nvim-treesitter-5f2c6c0c833734914080ae061e2a7d44bc606180.tar.bz2
nvim-treesitter-5f2c6c0c833734914080ae061e2a7d44bc606180.tar.lz
nvim-treesitter-5f2c6c0c833734914080ae061e2a7d44bc606180.tar.xz
nvim-treesitter-5f2c6c0c833734914080ae061e2a7d44bc606180.tar.zst
nvim-treesitter-5f2c6c0c833734914080ae061e2a7d44bc606180.zip
refactor: pull out predicate function
-rw-r--r--lua/nvim-treesitter/install.lua20
1 files changed, 9 insertions, 11 deletions
diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua
index 44e7e048f..b6e3c3de3 100644
--- a/lua/nvim-treesitter/install.lua
+++ b/lua/nvim-treesitter/install.lua
@@ -145,18 +145,16 @@ local function get_compile_location(repo, cache_dir, project_name, from_local_pa
return fs.joinpath(cache_dir, repo_location)
end
+local function istring(c)
+ return type(c) == 'string'
+end
+
local function cc_err()
- log.error('No C compiler found! "' .. table.concat(
- vim.iter.filter(
- ---@param c string
- ---@return boolean
- function(c)
- return type(c) == 'string'
- end,
- M.compilers
- ),
- '", "'
- ) .. '" are not executable.')
+ log.error(
+ 'No C compiler found! "'
+ .. table.concat(vim.iter.filter(istring, M.compilers), '", "')
+ .. '" are not executable.'
+ )
end
--- @param x string