From 72d0cad3530d877401ad9674f5266c79fbec396b Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Mon, 22 Jul 2024 08:38:32 +0200 Subject: [PATCH] feat(grug-far): no longer needed to call visual replace separately --- lua/lazyvim/plugins/editor.lua | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 2e6444a1..28808394 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -135,15 +135,12 @@ return { { "sr", 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 ext = vim.bo.buftype == "" and vim.fn.expand("%:e") - local filesFilter = ext and ext ~= "" and "*." .. ext or nil; - (is_visual and grug.with_visual_selection or grug.grug_far)({ - prefills = { filesFilter = filesFilter }, + grug.grug_far({ + prefills = { + filesFilter = ext and ext ~= "" and "*." .. ext or nil, + }, }) end, mode = { "n", "v" },