replacer.nvim icon indicating copy to clipboard operation
replacer.nvim copied to clipboard

Renaming files also changes the content

Open dstadelm opened this issue 2 years ago • 4 comments

Given populating the quickfix list with telescope find_files When running :lua require("replacer").run()<cr> And renaming the files Then the contents of the first line of the renamed files also is modified

dstadelm avatar Oct 06 '22 15:10 dstadelm

@dstadelm thank you for opening an issue! I can't replicate it, can you provide more details?

gabrielpoca avatar Oct 10 '22 18:10 gabrielpoca

Sorry for my delayed response. I was on vacation ;-)

Step 1: Selecting two files test1.txt and test2.txt containing the text as shown in the cat output

image

Step2: :lua require("replacer").run()<cr> image

Step3: rename files image

Step 4: Write quickfix buffer image

Step5: cat result image

The text in the file is replaced with the content after the colon in the quickfixlist. But I don't know how to achieve the correct content after the colon.

dstadelm avatar Oct 25 '22 06:10 dstadelm

It might be relevant, that I'm using Telescope find_files not live_grep

dstadelm avatar Oct 25 '22 07:10 dstadelm

@dstadelm thank you! Yeah, that's expected, unfortunately, and I'm unsure how I would fix it. I'm parsing that text in the quickfix window, assuming the context of the contents of the line is on the right, which is not the case with find_files since it's not picking a line. So when I'm saving the changes, I replace the line because it's like you changed it. I need to investigate, but seems weird to me that it's showing the file name on the right as well

gabrielpoca avatar Oct 25 '22 09:10 gabrielpoca