MagicDuck / grug-far.nvim

Find And Replace plugin for neovim
MIT License
807 stars 23 forks source link

[Bug] Toggle flag binding toggles on the wrong line with multiline search #273

Closed Ajaymamtora closed 4 weeks ago

Ajaymamtora commented 1 month ago
Screenshot 2024-09-25 at 22 10 26

Seems to be toggling the flag on the wrong line when theres a multiline search or multiline replace, it should account for the varying number of lines of input in these fields.

Im using the config from the readme

    local grp = vim.api.nvim_create_augroup("my-grug-far-custom-keybinds", { clear = true })
    vim.api.nvim_create_autocmd("FileType", {
      group = grp,
      pattern = { "grug-far" },
      callback = function()
        vim.keymap.set("n", "<M-l>", function()
          local state = unpack(require("grug-far").toggle_flags({ "--fixed-strings" }))
          vim.notify("grug-far: toggled fixed strings " .. (state and "ON" or "OFF"))
        end, { buffer = true })
      end,
    })
MagicDuck commented 4 weeks ago

good catch, I forgot to fix this one when I added multiline input support. Should be good now! 😄