mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-21 16:39:06 +02:00
fix(telescope): check for gmake if needed
This commit is contained in:
parent
a86c25286b
commit
0bc09d8206
1 changed files with 9 additions and 4 deletions
|
@ -4,8 +4,13 @@ if lazyvim_docs then
|
||||||
vim.g.lazyvim_picker = "telescope"
|
vim.g.lazyvim_picker = "telescope"
|
||||||
end
|
end
|
||||||
|
|
||||||
local have_make = vim.fn.executable("make") == 1
|
local build_cmd ---@type string?
|
||||||
local have_cmake = vim.fn.executable("cmake") == 1
|
for _, cmd in ipairs({ "make", "cmake", "gmake" }) do
|
||||||
|
if vim.fn.executable(cmd) == 1 then
|
||||||
|
build_cmd = cmd
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
---@type LazyPicker
|
---@type LazyPicker
|
||||||
local picker = {
|
local picker = {
|
||||||
|
@ -63,9 +68,9 @@ return {
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{
|
{
|
||||||
"nvim-telescope/telescope-fzf-native.nvim",
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
build = have_make and "make"
|
build = (build_cmd ~= "cmake") and "make"
|
||||||
or "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
|
or "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
|
||||||
enabled = have_make or have_cmake,
|
enabled = build_cmd ~= nil,
|
||||||
config = function(plugin)
|
config = function(plugin)
|
||||||
LazyVim.on_load("telescope.nvim", function()
|
LazyVim.on_load("telescope.nvim", function()
|
||||||
local ok, err = pcall(require("telescope").load_extension, "fzf")
|
local ok, err = pcall(require("telescope").load_extension, "fzf")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue