We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c4abcde + c176e85 commit 6785cfdCopy full SHA for 6785cfd
2 files changed
lua/spectre/config.lua
@@ -178,10 +178,7 @@ local config = {
178
replace_engine = {
179
['sed'] = {
180
cmd = 'sed',
181
- args = {
182
- '-i',
183
- '-E',
184
- },
+ args = nil,
185
options = {
186
['ignore-case'] = {
187
value = '--ignore-case',
lua/spectre/replace/sed.lua
@@ -5,13 +5,18 @@ local log = require('spectre._log')
5
local sed = {}
6
7
sed.init = function(_, config)
8
+ local uname = vim.loop.os_uname().sysname
9
+ local sed_args
10
+ if uname == 'Darwin' then
11
+ sed_args = { '-i', '', '-e' }
12
+ else
13
+ sed_args = { '-i', '-E' }
14
+ end
15
+
16
config = vim.tbl_extend('force', {
17
18
pattern = '%s,%ss/%s/%s/g',
19
+ args = sed_args,
20
}, config or {})
21
return config
22
end
0 commit comments