Skip to content

Commit

Permalink
nvim (overseer): update GrepCWord
Browse files Browse the repository at this point in the history
  • Loading branch information
sfrieds3 committed Jan 10, 2025
1 parent dd0e135 commit 874f2f8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nvim/dot-config/nvim/lua/plugins/overseer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ local function get_grep_cmd(params, opts)
params = opts.params or params
local rg_flags = opts.rg_flags or ""

if type(params.args) == "function" then
params.args = params.args()
end

-- Insert args at the '$*' in the grepprg
local cmd, num_subs = vim.o.grepprg:gsub("%$%*", params.args)
if num_subs == 0 then
Expand All @@ -61,7 +65,11 @@ function M.config()
Grep = {},
GrepAll = { rg_flags = "-uuu --hidden" },
GrepHidden = { rg_flags = "--hidden" },
GrepCWord = { params = { args = vim.fn.expand("<cword>") } },
GrepCWord = { params = {
args = function()
return vim.fn.expand("<cword>")
end,
} },
}

for cmd, opts in pairs(grep_cmds) do
Expand Down

0 comments on commit 874f2f8

Please sign in to comment.