From af29667d47258f6f0b44bdccae9cfbe24134c29b Mon Sep 17 00:00:00 2001 From: med8bra Date: Mon, 29 Jul 2024 01:21:58 +0100 Subject: [PATCH] fix(sed): detect sed on darwin use sed if available in darwin, useful for darwin-nix users where `gnused` is installed as `sed` --- lua/spectre/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/spectre/init.lua b/lua/spectre/init.lua index 471ce5c..e8dfd0c 100644 --- a/lua/spectre/init.lua +++ b/lua/spectre/init.lua @@ -43,7 +43,7 @@ end M.check_replace_cmd_bins = function() if state.user_config.default.replace.cmd == 'sed' then - if vim.loop.os_uname().sysname == 'Darwin' then + if vim.loop.os_uname().sysname == 'Darwin' and vim.fn.executable('sed') == 0 then config.replace_engine.sed.cmd = 'gsed' if vim.fn.executable('gsed') == 0 and state.user_config.replace_engine.sed.warn then print("You need to install gnu sed 'brew install gnu-sed'")