AckslD / muren.nvim

Multiple replacements in neovim
363 stars 5 forks source link

[Bug]: Wrong range replacing #32

Closed TroySigX closed 1 year ago

TroySigX commented 1 year ago

Reproduce Steps

I have the following lua file:

local opt = vim.opt
opt.termguicolors = true
opt.relativenumber = true
opt.tabstop = 2
opt.shiftwidth = 2
opt.softtabstop = 2

I then select from line 2 (opt.termguicolors = true) to the end of file, and replace opt with x

Expected behavior:

replace opt to x from line 2 to end

Actual Behavior:

line 2 is not changed (only from line 3 to end)

AckslD commented 1 year ago

Hmm, that's strange, it seems to work as expected for me:

https://github.com/AckslD/muren.nvim/assets/23341710/82894c68-ed61-4515-a9ca-95ccb8f5f8f1

TroySigX commented 1 year ago

@AckslD Hmm, maybe it just the preview display. Notice that in the preview panel, it only shows 4 replacements, when in fact, there are 5 of them

AckslD commented 1 year ago

@TroySigX Oh, yes I see, I think #33 should fix this but feel free to confirm

TroySigX commented 1 year ago

Thank you!!! But it seems if the beginning of the range is the first line of buffer, the preview doesn't show anything at all. Have a look at this:

https://github.com/AckslD/muren.nvim/assets/88051085/9b5a5f33-9635-40a2-85b1-c1f843b88b3f

AckslD commented 1 year ago

I see, thanks @TroySigX, should be fixed by #34

TroySigX commented 1 year ago

Thank you so much! I confirm that it is fixed.