feat(grug-far): no longer needed to call visual replace separately
This commit is contained in:
@ -135,15 +135,12 @@ return {
|
|||||||
{
|
{
|
||||||
"<leader>sr",
|
"<leader>sr",
|
||||||
function()
|
function()
|
||||||
local is_visual = vim.fn.mode():lower():find("v")
|
|
||||||
if is_visual then -- needed to make visual selection work
|
|
||||||
vim.cmd([[normal! v]])
|
|
||||||
end
|
|
||||||
local grug = require("grug-far")
|
local grug = require("grug-far")
|
||||||
local ext = vim.bo.buftype == "" and vim.fn.expand("%:e")
|
local ext = vim.bo.buftype == "" and vim.fn.expand("%:e")
|
||||||
local filesFilter = ext and ext ~= "" and "*." .. ext or nil;
|
grug.grug_far({
|
||||||
(is_visual and grug.with_visual_selection or grug.grug_far)({
|
prefills = {
|
||||||
prefills = { filesFilter = filesFilter },
|
filesFilter = ext and ext ~= "" and "*." .. ext or nil,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
mode = { "n", "v" },
|
mode = { "n", "v" },
|
||||||
|
Reference in New Issue
Block a user