Skip to content

Commit

Permalink
fix: add sed/gsed healthcheck if nvim-spectre is enabled #56
Browse files Browse the repository at this point in the history
  • Loading branch information
Allaman committed Jul 29, 2023
1 parent 03b024a commit c440e78
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion lua/core/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ local exec_found_template = "'%s' executable found"

M.check = function()
vim.health.start("System configuration")
local os = utils.getOS()

if not utils.isNeovimVersionsatisfied(10) then
_warn("This config probably won't work very well with Neovim < 0.10")
else
_ok("This config will work with your Neovim version")
end

local os = utils.getOS()
if os == "NixOS" then
_warn("This config downloads and runs binaries which might cause an issue on NixOS")
elseif os == "" then
Expand Down Expand Up @@ -89,6 +89,22 @@ M.check = function()
_warn("Python was not found - some Python related features might not work")
end
end

if settings.enable_spectre then
if os == "Darwin" then
if not utils.isExecutableAvailable("gsed") then
_warn("gsed was not found - nvim-spectre (search and replace) might not work")
else
_ok(string.format(exec_found_template, "gsed"))
end
else
if not utils.isExecutableAvailable("sed") then
_warn("sed was not found - nvim-spectre (search and replace) might not work")
else
_ok(string.format(exec_found_template, "sed"))
end
end
end
end

return M

0 comments on commit c440e78

Please sign in to comment.